forked from mtusi2026/mtusi2026lab2
Reject NUL input before authentication and text persistence
This commit is contained in:
@@ -37,7 +37,7 @@ def basic_credentials(value: str) -> tuple[str, str] | None:
|
||||
except Base64Error, UnicodeDecodeError:
|
||||
return None
|
||||
username, separator, password = decoded.partition(":")
|
||||
if not separator or not username.isascii():
|
||||
if not separator or not username.isascii() or "\x00" in username:
|
||||
return None
|
||||
return username, password
|
||||
|
||||
|
||||
Reference in New Issue
Block a user