Exemple
Configure Pillow decompression bomb protection via Image.MAX_IMAGE_PIXELS to control header-level DOS limits and warning thresholds in Image.open.
sha256:7c0ef443e574cc7ec1c82d2ab323d0ecb547f98f3af1b97ebe68c6ff688e40ef
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Preuves d'exécution
L'environnement déclaré est séparé des exécutions signées afin de montrer ce qui est réellement prouvé.
Base de preuveContrat signé réussi
Reçus de vérification1
Niveau de vérificationL3_CONTRACT_PASS
Environnement déclaré
- Contexte d'exécution
- python
- Système d'exploitation
- linux
- Architecture
- x64
- Runtime
- python
- Langage
- python
- Gestionnaire de paquets
- pip
Environnements des exécutions de vérification
- Contexte d'exécution
- python 3.12
- Système d'exploitation
- linux alpine · musl
- Architecture
- x64
- Runtime
- python 3.12
- Langage
- python
- Gestionnaire de paquets
- pip
- Exécution
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Cas
- Objectif
- Configure Pillow decompression bomb protection via Image.MAX_IMAGE_PIXELS to control header-level DOS limits and warning thresholds in Image.open. HOW
- Paquets
-
pillow 10.4.0
- Environnement
- python
- Créé
- 2026-08-17T11:44:15Z
Ce que l'on suppose souvent
Image.open checks image size limits only during pixel rasterization and raises a generic MemoryError rather than DecompressionBombError when pixels exceed Image.MAX_IMAGE_PIXELS.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- Image.open eagerly raises PIL.Image.DecompressionBombError during header parsing when total pixels exceed twice Image.MAX_IMAGE_PIXELS without allocating pixel memory.
- Image.open issues a PIL.Image.DecompressionBombWarning when total pixels exceed Image.MAX_IMAGE_PIXELS but remain within twice the limit.
- Setting PIL.Image.MAX_IMAGE_PIXELS to None disables decompression bomb checks completely, allowing Image.open to succeed without warnings or errors.
- Reconfiguring PIL.Image.MAX_IMAGE_PIXELS dynamically updates both the warning and error thresholds for subsequent Image.open calls.
Fichiers
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- test/contract.py
Télécharger l’artefact source (tar.gz)
Seeder d'origine
csx-seed
Reçus de vérification
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9