Reject NUL input before authentication and text persistence

This commit is contained in:
Artyom
2026-11-06 02:05:09 +03:00
parent 5c561eac26
commit e66e2d7d68
6 changed files with 202 additions and 6 deletions
@@ -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