Conversation
- Update .github/SECURITY.md with threat model summary and link to handbook - Add docs/handbook/security.rst with full STRIDE analysis (14 threats across Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege categories) - Add prioritised mitigation recommendations - Link security.rst into the handbook toctree Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a STRIDE-based threat model to the Pillow security documentation and links it from the handbook and GitHub Security Policy to help downstream integrators assess and mitigate risks when processing untrusted images.
Changes:
- Introduces a new
docs/handbook/security.rstpage with STRIDE threats and prioritized mitigations. - Adds the security page to the handbook
toctree. - Updates
.github/SECURITY.mdwith a threat model summary and link to the handbook page.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/handbook/security.rst | New STRIDE threat model and prioritized mitigation recommendations. |
| docs/handbook/index.rst | Links the new security page into the handbook navigation. |
| .github/SECURITY.md | Adds a threat model summary and links to the full handbook page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| To report sensitive vulnerability information, report it [privately on GitHub](https://github.com/python-pillow/Pillow/security/advisories/new). | ||
|
|
||
| If you cannot use GitHub, use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. |
There was a problem hiding this comment.
| If you cannot use GitHub, use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. | |
| If you cannot use GitHub, use the [Tidelift security contact](https://tidelift.com/docs/security). Tidelift will coordinate the fix and disclosure. |
This obviously isn't something you did, but https://tidelift.com/security redirects to https://tidelift.com/docs/security, and it feels neater to change this here than create a new PR
|
|
||
| ## Threat model | ||
|
|
||
| Pillow's primary attack surface is parsing untrusted image data. A full STRIDE threat model covering spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege is maintained in the [Security handbook page](https://pillow.readthedocs.io/en/stable/handbook/security.html). |
There was a problem hiding this comment.
| Pillow's primary attack surface is parsing untrusted image data. A full STRIDE threat model covering spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege is maintained in the [Security handbook page](https://pillow.readthedocs.io/en/stable/handbook/security.html). | |
| Pillow's primary attack surface is parsing untrusted image data. A full STRIDE threat model covering spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege is maintained in the [Security handbook page](https://pillow.readthedocs.io/en/latest/handbook/security.html). |
If we link to stable, then this link will be broken until July?
| ``DecompressionBombError`` at 2× the limit and | ||
| ``DecompressionBombWarning`` at 1×. PNG text chunks are |
There was a problem hiding this comment.
| ``DecompressionBombError`` at 2× the limit and | |
| ``DecompressionBombWarning`` at 1×. PNG text chunks are | |
| ``Image.DecompressionBombError`` at 2× the limit and | |
| ``Image.DecompressionBombWarning`` at 1×. PNG text chunks are |
| runtime or in the reference/source for the current defaults. | ||
|
|
||
| *Mitigations:* **never** set ``Image.MAX_IMAGE_PIXELS = None`` in production; | ||
| treat ``DecompressionBombWarning`` as an error; set OS/container memory limits |
There was a problem hiding this comment.
| treat ``DecompressionBombWarning`` as an error; set OS/container memory limits | |
| treat ``Image.DecompressionBombWarning`` as an error; set OS/container memory limits |
| libwebp, openjpeg, freetype, Ghostscript. Subscribe to `Pillow security | ||
| advisories <https://github.com/python-pillow/Pillow/security/advisories>`_. | ||
| 5. **Enforce** ``MAX_IMAGE_PIXELS`` — never set it to ``None``; treat | ||
| ``DecompressionBombWarning`` as an error. |
There was a problem hiding this comment.
| ``DecompressionBombWarning`` as an error. | |
| ``Image.DecompressionBombWarning`` as an error. |
| 10. **Log and alert** on ``DecompressionBombWarning``, | ||
| ``DecompressionBombError``, ``PIL.UnidentifiedImageError``, |
There was a problem hiding this comment.
| 10. **Log and alert** on ``DecompressionBombWarning``, | |
| ``DecompressionBombError``, ``PIL.UnidentifiedImageError``, | |
| 10. **Log and alert** on ``Image.DecompressionBombWarning``, | |
| ``Image.DecompressionBombError``, ``PIL.UnidentifiedImageError``, |
| <https://github.com/python-pillow/Pillow/security/advisories/new>`_. | ||
|
|
||
| If you cannot use GitHub, use the `Tidelift security contact | ||
| <https://tidelift.com/security>`_. Tidelift will coordinate the fix and |
There was a problem hiding this comment.
| <https://tidelift.com/security>`_. Tidelift will coordinate the fix and | |
| <https://tidelift.com/docs/security>`_. Tidelift will coordinate the fix and |
Changes proposed in this pull request: