afdudley / equanimity Goto Github PK
View Code? Open in Web Editor NEWA world building game with a heavy emphasis on squad-based turn-based combat and balance
License: Other
A world building game with a heavy emphasis on squad-based turn-based combat and balance
License: Other
After a fresh install of the application, I receive the following error when running create_world:
Traceback (most recent call last):
File "tools/create_world.py", line 86, in
create_world(force=args.force)
File "tools/create_world.py", line 33, in create_world
w.award_field(w.player, (0, 0), p)
File "/Users/greggkeithley/Work/Equanimity/equanimity_server/src/equanimity/equanimity/world.py", line 81, in award_field
new_owner.fields[c] = old_owner.fields[c]
File "/Users/greggkeithley/Work/Equanimity/equanimity_server/lib/python2.7/UserDict.py", line 23, in getitem
raise KeyError(key)
KeyError: (0, 0)
send_file
callA path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder. By manipulating variables that reference files with “dot-dot-slash (../)” sequences and its variations or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system including application source code or configuration and critical system files. This attack is also known as “dot-dot-slash”, “directory traversal”, “directory climbing” and “backtracking”.
The os.path.join
call is unsafe for use with untrusted input. When the os.path.join
call encounters an absolute path, it ignores all the parameters it has encountered till that point and starts working with the new absolute path. Please see the example below.
>>> import os.path
>>> static = "path/to/mySafeStaticDir"
>>> malicious = "/../../../../../etc/passwd"
>>> os.path.join(t,malicious)
'/../../../../../etc/passwd'
Since the "malicious" parameter represents an absolute path, the result of os.path.join
ignores the static directory completely. Hence, untrusted input is passed via the os.path.join
call to flask.send_file
can lead to path traversal attacks.
In this case, the problems occurs due to the following code :
equanimity/server/views/frontend.py
Line 25 in 16862ab
Here, the path
parameter is attacker controlled. This parameter passes through the unsafe os.path.join
call making the effective directory and filename passed to the send_file
call attacker controlled. This leads to a path traversal attack.
The bug can be verified using a proof of concept similar to the one shown below.
curl --path-as-is 'http://<domain>/js//../../../../etc/passwd"'
This can be fixed by preventing flow of untrusted data to the vulnerable send_file
function. In case the application logic necessiates this behaviour, one can either use the flask.safe_join
to join untrusted paths or replace flask.send_file
calls with flask.send_from_directory
calls.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.