fix(security): enforce S3 boundaries and configure persistent audit

This commit is contained in:
2026-11-20 19:35:35 +03:00
parent d6957b2f79
commit 7f6e8cbd27
13 changed files with 7976 additions and 34 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ def verify(stream, *, declared):
with DECODE_SLOT:
try:
stream.seek(0)
with Image.open(stream) as image:
with Image.open(stream, formats=["PNG", "JPEG"]) as image:
actual = {"PNG": "image/png", "JPEG": "image/jpeg"}.get(
image.format
)
@@ -50,7 +50,7 @@ def verify(stream, *, declared):
image.verify()
# JPEG verify alone does not decode entropy data.
stream.seek(0)
with Image.open(stream) as image:
with Image.open(stream, formats=["PNG", "JPEG"]) as image:
image.load()
except Image.DecompressionBombError:
raise DomainError(