Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aura: Sanitize filenames in image IDs #4160

Merged
merged 2 commits into from
Nov 26, 2021
Merged

aura: Sanitize filenames in image IDs #4160

merged 2 commits into from
Nov 26, 2021

Conversation

sampsyo
Copy link
Member

@sampsyo sampsyo commented Nov 26, 2021

When constructing paths to image files to serve, we previously spliced strings from URL requests directly into the path to be opened. This is theoretically worrisome because it could allow clients to read other files that they are not supposed to read.

I'm not actually sure this is a real security problem because Flask's URL parsing should probably rule out IDs that have / in them anyway. But out of an abundance of caution, this now prevents paths from showing up in IDs at all—and also prevents . and .. from being valid names.

Closes #4111.

When constructing paths to image files to serve, we previously spliced
strings from URL requests directly into the path to be opened. This is
theoretically worrisome because it could allow clients to read other
files that they are not supposed to read.

I'm not actually sure this is a real security problem because Flask's
URL parsing should probably rule out IDs that have `/` in them anyway.
But out of an abundance of caution, this now prevents paths from showing
up in IDs at all---and also prevents `.` and `..` from being valid
names.
@sampsyo sampsyo merged commit c03e0eb into master Nov 26, 2021
@sampsyo sampsyo mentioned this pull request Nov 28, 2021
@snejus snejus deleted the filter-img-filename branch June 15, 2024 03:43
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.

None
1 participant