mirror of
https://github.com/DragonMinded/bemaniutils.git
synced 2026-06-03 06:24:16 -05:00
frontend: Patch path traversal vulnerability
This commit is contained in:
parent
33d0000c77
commit
f0792067b7
|
|
@ -130,6 +130,10 @@ def cacheable(max_age: int) -> Callable:
|
|||
def jsx(filename: str) -> Response:
|
||||
# Figure out what our update time is to namespace on
|
||||
jsxfile = os.path.join(static_location, filename)
|
||||
normalized_path = os.path.normpath(jsxfile)
|
||||
# Check for path traversal exploit
|
||||
if not normalized_path.startswith(static_location):
|
||||
raise IOError()
|
||||
mtime = os.path.getmtime(jsxfile)
|
||||
namespace = f'{mtime}.{jsxfile}'
|
||||
jsx = g.cache.get(namespace)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user