Validate that string is base64 (#648)

This commit is contained in:
maraspr
2026-01-08 16:15:27 +01:00
committed by GitHub
parent 1f3a1fc843
commit 792079a3e8

View File

@@ -892,7 +892,7 @@ def extract_report(content: Union[bytes, str, BinaryIO]) -> str:
try: try:
if isinstance(content, str): if isinstance(content, str):
try: try:
file_object = BytesIO(b64decode(content)) file_object = BytesIO(b64decode(content, validate=True))
except binascii.Error: except binascii.Error:
return content return content
header = file_object.read(6) header = file_object.read(6)