Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ check(path, Policy(formats={"tiff", "pdf"}, max_pages=50))
| `tiff_subsamplings` | 1x1, 2x1, 1x2, 2x2 | the same | Which chroma subsamplings a YCbCr TIFF may declare. The factor-of-four paths are where libtiff's most recent heap write was found (CVE-2026-4775) |
| `tiff_compressions` | none, ccitt, lzw, jpeg, deflate, packbits | the same | How a TIFF may be compressed, by name. The other codecs in libtiff are where most of its flaws have been found (PixarLog most recently, CVE-2026-12912), and a scan never needs them. A code the library does not know is refused whatever the policy says, and every frame must use the same scheme |
| `jpeg_frames` | baseline, extended, progressive | the same | How a JPEG's frame may be coded. Lossless, hierarchical and arithmetic frames are legal JPEG that no scanner writes and the decoder's least-exercised code; a lossless frame was the way into a heap overflow in Pillow's JPEG decoder (CVE-2026-112403) |
| `tiff_tags` | standard, metadata, private | the same | Which kinds of tag a TIFF's directories may hold. Standard is the TIFF 6.0 set; metadata the registered blocks (XMP, IPTC, Photoshop, Exif, ICC, GPS, GeoTIFF); private everything else, the vendor and DNG tags a scan never carries. A read is not harmed by a private tag, so the default allows all three; a program that saves a file back as TIFF with its tag table carries every tag into libtiff's encoder, where a crafted one copied process memory into the output (CVE-2026-112902), and should allow standard and metadata only |
| `allow_inconsistent_tiff_tags` | yes | yes | Pass a TIFF whose tags contradict each other: a ColorMap of the wrong size for the bit depth (CVE-2026-112896), a floating-point Predictor on integer samples (CVE-2026-112396). No scanner writes either; both reach an encoder that trusts the tag. Allowed by default because refusing a file that passed before is breaking; a policy for files from outside should refuse |
| `allow_encrypted_pdf` | no | no | A scanned book is never encrypted |
| `pdf_features` | none | none | Which of JavaScript, forms, attached files and launch actions a PDF may carry. Each makes a viewer do something other than draw the page, and a scanned book has none. Forms are read from `pdfinfo`'s report and attached files from `pdfdetach`'s; a launch action is found by its name in the file, since no poppler tool reports one; JavaScript is looked for both ways |
| `pdf_image_codecs` | jpeg, jpx, jbig2, ccitt | the same | Which codecs a PDF's images may be coded with: JPEG, JPEG 2000 (OpenJPEG), JBIG2 and CCITT fax. Each hands the stream to a decoder of its own inside poppler, and the JBIG2 decoder is where several of its flaws have been (CVE-2025-32365, CVE-2026-93312, CVE-2026-93313). Scanners and the archives that derive PDFs from scans write all four, so both presets allow them; refuse one only when you know your source never writes it. Found by the filter's name in the file, not by `pdfimages -list`, which opens a JPX stream with OpenJPEG just to describe it |
Expand Down Expand Up @@ -180,8 +182,10 @@ prints one object per line for a pipeline; `-q` prints only refusals.
layout (photometric interpretation and, for YCbCr, chroma subsampling,
both of which the policy names; samples per pixel; bits per sample),
all of which must be the same in every frame, since the decoder sizes
its buffers from the first, its tile size if it is tiled, and every
tag's data checked to lie inside the file; the chain is walked with a limit and a memory of where it has
its buffers from the first, its tile size if it is tiled, every
tag's data checked to lie inside the file, every tag sorted into
standard, metadata or private, and its ColorMap and Predictor checked
against its samples; the chain is walked with a limit and a memory of where it has
been, so that one that loops or points off the end of the file is a
refusal, not a hang. Every read is bounded and
every offset is checked against the file's size. For a PDF,
Expand Down
30 changes: 0 additions & 30 deletions docs/advisories/proposed/CVE-2026-112396.json

This file was deleted.

30 changes: 0 additions & 30 deletions docs/advisories/proposed/CVE-2026-112896.json

This file was deleted.

29 changes: 0 additions & 29 deletions docs/advisories/proposed/CVE-2026-112902.json

This file was deleted.

113 changes: 110 additions & 3 deletions docs/advisories/record.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"other": "some other way; the finding says"
},
"counts": {
"records": 120,
"records": 123,
"refused_by_default": 44,
"by_bucket": {
"A": 39,
"B": 16,
"B": 19,
"B2": 3,
"C": 19,
"D": 3,
Expand All @@ -31,7 +31,7 @@
"by_library": {
"FreeType": 4,
"OpenJPEG": 6,
"Pillow": 58,
"Pillow": 61,
"libpng": 15,
"libtiff": 18,
"poppler": 16,
Expand Down Expand Up @@ -528,6 +528,41 @@
"checked": "2026-11-03",
"notes": "Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03. Re-read on 2026-11-03: no file carries the trigger."
},
{
"key": "CVE-2026-112902",
"aliases": [],
"library": "Pillow",
"package": "pillow",
"ecosystem": "PyPI",
"title": "Crafted TIFF tags make Pillow's libtiff encoder copy process memory into the output",
"summary": "Pillow: Memory disclosure and segfault in libtiff encoder via crafted TIFF tags",
"published": "2026-10-21",
"severity": null,
"affected": "< 12.3.0",
"fixed": "12.3.0",
"reached_by": "save",
"trigger": "Opening a crafted TIFF and saving it back as TIFF with its tags.",
"bucket": "B",
"finding": "The crafted tags (DNGPrivateData and ActiveArea, private and DNG tags a scan never carries) ride from the opened file's tag table into a bare save, through libtiff whenever the file is compressed, with no option from the program. The tags are in the directory the reader walks, and every tag is sorted into standard, metadata or private: a policy allowing standard and metadata tags refuses the file before Pillow sees it (tiff_tags). The default allows private tags, since a vendor's own tag in a scanner's output is harmless on a read, so the setting is what closes this. Tetrak OCR copies each frame before saving, which drops the tag table, so it is not reached there.",
"refusal": {
"check": "tiff_tags",
"default": false,
"setting": "Policy(tiff_tags={\"standard\", \"metadata\"})"
},
"verified_by": [
"tests/test_check.py::TestHostileFiles::test_a_tiff_with_private_tags_under_a_policy_without_them"
],
"protect": {
"general": "Upgrade to Pillow 12.3.0.",
"specific": "Allow standard and metadata tags only (tiff_tags) wherever a file from outside is saved back as TIFF with its tag table; upgrade to Pillow 12.3.0."
},
"sources": [
"https://osv.dev/vulnerability/GHSA-xvh5-g6gv-559v"
],
"triaged": "2026-11-03",
"checked": "2026-11-03",
"notes": "Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03. Re-read on 2026-11-03 against the question of what rides from an opened file into a save: the file is the input. Bucket and finding confirmed by a person on 2026-11-03; waits for the policy on a TIFF's tags and its test before it can be promoted. The policy was built on 2026-11-03 (sillybos 4.2.0)."
},
{
"triaged": "2026-11-01",
"checked": "2026-11-01",
Expand Down Expand Up @@ -1225,6 +1260,42 @@
"https://github.com/advisories/GHSA-462x-pgg6-55fp"
]
},
{
"key": "CVE-2026-112896",
"aliases": [],
"library": "Pillow",
"package": "pillow",
"ecosystem": "PyPI",
"title": "Saving a TIFF with a retained ColorMap over-reads in Pillow's encoder",
"summary": "Pillow: TIFF encoder ColorMap plane-size mismatch causes a heap out-of-bounds read",
"published": "2026-10-19",
"severity": null,
"affected": "< 12.3.0",
"fixed": "12.3.0",
"reached_by": "save",
"trigger": "Opening a 16-bit palette TIFF with a 768-entry ColorMap and saving it back as TIFF with its metadata.",
"bucket": "B",
"finding": "The ColorMap rides from the opened file's tag table into a save that keeps its metadata. The tag is in the directory the reader walks, and its 768 entries disagree with 16-bit samples, which need 196,608: the reader reports the contradiction, and a policy that refuses inconsistent tags refuses the file before Pillow sees it (allow_inconsistent_tiff_tags). The default allows it, because refusing a file that passed before is breaking, so the setting is what closes this.",
"refusal": {
"check": "allow_inconsistent_tiff_tags",
"default": false,
"setting": "Policy(allow_inconsistent_tiff_tags=False)"
},
"verified_by": [
"tests/test_check.py::TestHostileFiles::test_a_tiff_whose_colormap_does_not_fit_its_depth"
],
"protect": {
"general": "Upgrade to Pillow 12.3.0.",
"specific": "Refuse inconsistent TIFF tags (allow_inconsistent_tiff_tags off) for files from outside; upgrade to Pillow 12.3.0."
},
"sources": [
"https://osv.dev/vulnerability/GHSA-pchr-8j38-3x4p",
"https://osv.dev/vulnerability/PYSEC-2026-4334"
],
"triaged": "2026-11-03",
"checked": "2026-11-03",
"notes": "Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03. Re-read on 2026-11-03 against the question of what rides from an opened file into a save: the file is the input. Bucket and finding confirmed by a person on 2026-11-03; waits for the policy on a TIFF's tags and its test before it can be promoted. The policy was built on 2026-11-03 (sillybos 4.2.0)."
},
{
"key": "CVE-2026-112405",
"aliases": [],
Expand Down Expand Up @@ -1328,6 +1399,42 @@
"checked": "2026-11-03",
"notes": "Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03."
},
{
"key": "CVE-2026-112396",
"aliases": [],
"library": "Pillow",
"package": "pillow",
"ecosystem": "PyPI",
"title": "Encoding a TIFF to memory uses a freed buffer when libtiff rejects a tag",
"summary": "Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer",
"published": "2026-10-19",
"severity": 5.9,
"affected": "< 12.3.0",
"fixed": "12.3.0",
"reached_by": "save",
"trigger": "Image.save(format=\"TIFF\") to an in-memory buffer with a tag libtiff rejects.",
"bucket": "B",
"finding": "The rejected tag, a floating-point Predictor on integer samples in the report's example, rides into the save when the program keeps the opened file's tag table. The reader reads the Predictor and the SampleFormat and reports the contradiction, and a policy that refuses inconsistent tags refuses the file before Pillow sees it (allow_inconsistent_tiff_tags). The default allows it, because refusing a file that passed before is breaking, so the setting is what closes this.",
"refusal": {
"check": "allow_inconsistent_tiff_tags",
"default": false,
"setting": "Policy(allow_inconsistent_tiff_tags=False)"
},
"verified_by": [
"tests/test_check.py::TestHostileFiles::test_a_tiff_with_a_floating_point_predictor_on_integer_samples"
],
"protect": {
"general": "Upgrade to Pillow 12.3.0.",
"specific": "Refuse inconsistent TIFF tags (allow_inconsistent_tiff_tags off) for files from outside, and save to a file rather than memory; upgrade to Pillow 12.3.0."
},
"sources": [
"https://osv.dev/vulnerability/GHSA-4rr5-89j8-mwwm",
"https://osv.dev/vulnerability/PYSEC-2026-4328"
],
"triaged": "2026-11-03",
"checked": "2026-11-03",
"notes": "Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03. Re-read on 2026-11-03 against the question of what rides from an opened file into a save: the file is the input. Bucket and finding confirmed by a person on 2026-11-03; waits for the policy on a TIFF's tags and its test before it can be promoted. The policy was built on 2026-11-03 (sillybos 4.2.0)."
},
{
"key": "CVE-2026-112394",
"aliases": [],
Expand Down
36 changes: 36 additions & 0 deletions docs/advisories/record/CVE-2026-112396.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"key": "CVE-2026-112396",
"aliases": [],
"library": "Pillow",
"package": "pillow",
"ecosystem": "PyPI",
"title": "Encoding a TIFF to memory uses a freed buffer when libtiff rejects a tag",
"summary": "Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer",
"published": "2026-10-19",
"severity": 5.9,
"affected": "< 12.3.0",
"fixed": "12.3.0",
"reached_by": "save",
"trigger": "Image.save(format=\"TIFF\") to an in-memory buffer with a tag libtiff rejects.",
"bucket": "B",
"finding": "The rejected tag, a floating-point Predictor on integer samples in the report's example, rides into the save when the program keeps the opened file's tag table. The reader reads the Predictor and the SampleFormat and reports the contradiction, and a policy that refuses inconsistent tags refuses the file before Pillow sees it (allow_inconsistent_tiff_tags). The default allows it, because refusing a file that passed before is breaking, so the setting is what closes this.",
"refusal": {
"check": "allow_inconsistent_tiff_tags",
"default": false,
"setting": "Policy(allow_inconsistent_tiff_tags=False)"
},
"verified_by": [
"tests/test_check.py::TestHostileFiles::test_a_tiff_with_a_floating_point_predictor_on_integer_samples"
],
"protect": {
"general": "Upgrade to Pillow 12.3.0.",
"specific": "Refuse inconsistent TIFF tags (allow_inconsistent_tiff_tags off) for files from outside, and save to a file rather than memory; upgrade to Pillow 12.3.0."
},
"sources": [
"https://osv.dev/vulnerability/GHSA-4rr5-89j8-mwwm",
"https://osv.dev/vulnerability/PYSEC-2026-4328"
],
"triaged": "2026-11-03",
"checked": "2026-11-03",
"notes": "Proposed from the advisory's text on 2026-11-01, as part of folding the backfill into the record; confirmed by a person on 2026-11-03. Re-read on 2026-11-03 against the question of what rides from an opened file into a save: the file is the input. Bucket and finding confirmed by a person on 2026-11-03; waits for the policy on a TIFF's tags and its test before it can be promoted. The policy was built on 2026-11-03 (sillybos 4.2.0)."
}
Loading
Loading