ValueError when null byte in URL #2574
Unanswered
stefan-hoelzl
asked this question in
Q&A
Replies: 2 comments
-
For some more context, this happens when filename contains a null byte (such filenames are invalid). I suppose a fix would be to sanitize filenames or to improve exception handling. I prefer the latter since it will not impact the performance of normal requests. It will also be much simpler in code. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This seems to be a cpython issue. I created a PR to fix this issue python/cpython#117573 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
today someone tried a bunch of URLs on my online service (using starlette).
On one URL (
/%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD/%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD/%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD/etc/passwd%00
) starlette (specific the StaticFiles Middleware) raised anValueError: embedded null byte
.This is the full StackTrace
I would expect starlette to handle this in someway instead of raising an exception.
Important
Beta Was this translation helpful? Give feedback.
All reactions