Allow staticfiles to follow symlinks outside directory#1377
Allow staticfiles to follow symlinks outside directory#1377
Conversation
3dee9ab to
6b6fe29
Compare
|
isn't that behavior a security concern and would allow path traversal ? |
euri10
left a comment
There was a problem hiding this comment.
added a few comments mostly about os.path vs pathlib stuff, so not blocking on my side but I would see it as probably more readable
thoughts ?
|
Please do not merge until 0.19.1 is released. This should be up on 0.20.0. |
e201817 to
0291dd4
Compare
0291dd4 to
2c86a96
Compare
|
@Kludex Can we merge this now? |
|
correct me if I'm wrong, but this PR changes the API from |
|
2c86a96 to
422983c
Compare
…tarlette into fix-staticfiles-follow-symlinks
…tarlette into fix-staticfiles-follow-symlinks
Kludex
left a comment
There was a problem hiding this comment.
LGTM! 👍
I've added a comment about an alternative solution, but use whatever you prefer.
Fixes #1083.
Right now we don't allow StaticFiles to break outside of statics directory:
https://github.com/encode/starlette/blob/0aef1724cfafbe23f846979d427a5a173667f6b7/starlette/staticfiles.py#L162-L165
Since we already follow symlinks for directory and path, I think it makes sense to allow StaticFiles to break out of statics directory if it's following a symlink.