Python: Small fixup for flask.send_from_directory
#6989
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few fixups to #6330
I think the most controversial thing is in 8c3349f, where I exclude the
filename
arugment from being a path-injection sink. This could have been done in a different way. I considered adding a new concept for this (since htat is what we usually do), but I felt that would become WAY too query specific. So I ended up just going directly to the query.I also questioned the value in even modeling the
filename
argument as aFileSystemAccess
-- asking myself who would ever benefit from this bit of modeling? I'm not sure... but from our very general concept, it doesn't seem obvious that arguments that accepts paths, which are internally made safe from path-injection should be excluded (although simply removing that modeling would have been an easy fix for sure).