Skip to content

Fix symlink bypass in file-serving path checks (CWE-59) - #1547

Open
AAtomical wants to merge 1 commit into
kizniche:masterfrom
AAtomical:master
Open

Fix symlink bypass in file-serving path checks (CWE-59)#1547
AAtomical wants to merge 1 commit into
kizniche:masterfrom
AAtomical:master

Conversation

@AAtomical

Copy link
Copy Markdown

Replace os.path.abspath() with os.path.realpath() in file-serving containment checks so symlinks are resolved before the startswith() comparison. Add trailing os.sep to prevent prefix collisions with sibling directories.
fix #1546

Replace os.path.abspath() with os.path.realpath() in file-serving
containment checks so symlinks are resolved before the startswith()
comparison. Add trailing os.sep to prevent prefix collisions with
sibling directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symlink bypass in file-serving routes allows reading files outside allowed directories

1 participant