Skip to content

Add STRIDE threat model to security docs#9562

Draft
aclark4life wants to merge 4 commits intomainfrom
stride
Draft

Add STRIDE threat model to security docs#9562
aclark4life wants to merge 4 commits intomainfrom
stride

Conversation

@aclark4life
Copy link
Copy Markdown
Member

Changes proposed in this pull request:

  • 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

aclark4life and others added 2 commits April 14, 2026 12:13
- 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>
@aclark4life aclark4life requested a review from Copilot April 14, 2026 23:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rst page with STRIDE threats and prioritized mitigations.
  • Adds the security page to the handbook toctree.
  • Updates .github/SECURITY.md with 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.

aclark4life and others added 2 commits April 14, 2026 20:08
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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Comment on lines +144 to +145
``DecompressionBombError`` at 2× the limit and
``DecompressionBombWarning`` at 1×. PNG text chunks are
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``DecompressionBombWarning`` as an error.
``Image.DecompressionBombWarning`` as an error.

Comment on lines +245 to +246
10. **Log and alert** on ``DecompressionBombWarning``,
``DecompressionBombError``, ``PIL.UnidentifiedImageError``,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<https://tidelift.com/security>`_. Tidelift will coordinate the fix and
<https://tidelift.com/docs/security>`_. Tidelift will coordinate the fix and

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants