Skip to content

Add STRIDE threat model to security docs#9562

Merged
aclark4life merged 14 commits intomainfrom
stride
Apr 22, 2026
Merged

Add STRIDE threat model to security docs#9562
aclark4life merged 14 commits intomainfrom
stride

Conversation

@aclark4life
Copy link
Copy Markdown
Member

@aclark4life aclark4life commented Apr 14, 2026

PR docs: https://pillow--9562.org.readthedocs.build/en/9562/handbook/security.html


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
Contributor

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.

Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread .github/SECURITY.md Outdated
Comment thread .github/SECURITY.md Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
aclark4life and others added 2 commits April 15, 2026 13:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- docs/handbook/security.rst
- .github/SECURITY.md

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
Comment thread docs/handbook/security.rst Outdated
@aclark4life aclark4life marked this pull request as ready for review April 16, 2026 10:48
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
┌──────────────────────────────────────────┐
│ C libraries (bundled or system) │
│ libjpeg · libpng · libtiff · libwebp │
│ openjpeg · freetype · littlecms │
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.

I'm going to be a little picky and suggest littlecms2, rather than littlecms.

If this is intended to be a complete list, then it is missing libimagequant, libraqm, harfbuzz, fribidi, libavif, libxcb and zlib(-ng).

If it's not intended to be a complete list, then I question if libpng should here - it's something that's used by other dependencies, not by used by us directly, so it's not a top tier dependency.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure if it's intended to be a complete list and is littlecms2 a newer version of littlecms?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's go with not intended to be a complete list.

Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
**T-3 — Supply chain tampering**

Pre-compiled wheels bundle libjpeg-turbo, libpng, libtiff, libwebp, openjpeg,
freetype, and littlecms. A compromised PyPI release or build pipeline could
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.

Again, this is not a complete list.

*Mitigations:* pin with hash verification (``pip install --require-hashes``);
monitor `Pillow security advisories
<https://github.com/python-pillow/Pillow/security/advisories>`_; use
Dependabot or OSV-Scanner for bundled C library CVEs.
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.

Is this document aimed at users? This is mitigation advice for us.

Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
aclark4life and others added 5 commits April 21, 2026 11:11
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
- Add image.getexif() alongside image._getexif() in T-1 mitigations
- Remove 'appended bytes' from T-2 (Pillow does not preserve them on resave)
- Reframe R-1 threat as user-facing (not Pillow dev advice); add
  DecompressionBombError to the log/alert list
- Add blank line before E-3 heading
- Qualify dependency list in recommendation #4 as non-exhaustive

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@aclark4life
Copy link
Copy Markdown
Member Author

Comment Change
Line 74 — mention getexif() too Added image.getexif() alongside image._getexif() in T-1
Line 80 — "appended bytes" aren't preserved Removed "appended bytes" from T-2's hidden data list
Line 101 — R-1 reads as advice for Pillow devs Reframed threat description to be user/application-focused
Line 109 — also log DecompressionBombError Added Image.DecompressionBombError to R-1's log/alert list
Line 191 — missing blank line before E-3 Added the blank line
Line 228 — dependency list not complete Changed to "including … and others" to make it non-exhaustive

RST does not allow inline markup (backticks) nested inside bold
markers. Remove backticks from the E-3 and E-4 heading text so
they render correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Comment thread docs/handbook/security.rst Outdated
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@aclark4life aclark4life merged commit ecef4fb into main Apr 22, 2026
28 of 31 checks passed
@aclark4life aclark4life deleted the stride branch April 22, 2026 16:33
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