Skip to content

feat!: hold every page, frame and tile to max_side on its longest side - #13

Merged
stephen-masters merged 1 commit into
mainfrom
feat/max-side
Nov 1, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
feat/max-side

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

What

A new policy field, max_side, bounds either side of any one page, frame or tile. The pixel budget alone let through a page a few pixels wide and a million tall, and an abnormally tall image is what drove libtiff's RGBA reader to write colour data to an arbitrary address (CVE-2025-9900, bucket B in the backfill).

  • Policy.max_side: 30,000 by default (three times the longest side in the corpus, 9,933 pixels for A3 at 600 dpi), 15,000 under STRICT.
  • The JPEG, PNG and TIFF readers report the longest side across every frame they walk; the PDF path reports it across every page at the render dpi. Facts.max_side carries it.
  • A tile is held to it too, since the decoder allocates a tile whole.
  • sillybos --max-side N on the command line, and a row in the README's policy table.
  • Hostile corpus cases: a 2,000 x 40,000 TIFF within the pixel budget, a tall frame among many, a long thin tile, and a 5 x 200 inch PDF page.
  • The proposed record for CVE-2025-9900 now names the field and the test, so it can be promoted.

Breaking

A file that passed last week can be refused this week: a page, frame or tile longer than 30,000 pixels on a side now fails under the default policy. Per the release rule in AGENTS.md that is a feat!, so merging this cuts 4.0.0. Tetrak OCR pins >=3,<4 and will need its floor raised.

Checks

392 tests pass; ruff, mypy and twine check clean.

🤖 Generated with Claude Code

A pixel budget alone lets through a page a few pixels wide and a million
tall, and an abnormally tall image is what drove libtiff's RGBA reader to
write colour data to an arbitrary address (CVE-2025-9900). The new policy
field max_side bounds either side of any one page, frame or tile: 30,000
by default, three times the longest side in the corpus (9,933 pixels, A3
at 600 dpi), and 15,000 under STRICT. The readers report the longest side
across every frame they walk, the PDF path across every page at the
render dpi, and the command takes --max-side.

Breaking because a file that passed last week can be refused this week:
a page, frame or tile longer than 30,000 pixels on a side now fails under
the default policy. Set max_side to allow it.

The proposed record for CVE-2025-9900 now names the field and the test
that proves the refusal, so it can be promoted.

BREAKING CHANGE: the default policy refuses a page, frame or tile longer
than 30,000 pixels on either side; set max_side to allow it.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit 25d2162 into main Nov 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant