Skip to content

Harden malformed PDF handling - #11

Merged
Lulzx merged 1 commit into
mainfrom
agent/harden-malformed-pdf-handling
Aug 13, 2026
Merged

Harden malformed PDF handling#11
Lulzx merged 1 commit into
mainfrom
agent/harden-malformed-pdf-handling

Conversation

@Lulzx

@Lulzx Lulzx commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • reject cyclic and excessively long XRef revision chains
  • use checked parsing and conversions for attacker-controlled PDF numbers
  • bound structure-tree recursion and stop reference cycles
  • free empty WASM extraction buffers
  • enforce ErrorConfig error budgets, logging, missing-object, and encoding policies

Why

Malformed PDFs could previously cause integer-overflow aborts, infinite XRef traversal, structure-tree stack exhaustion, or repeated WASM heap growth.

Validation

  • zig build test
  • zig build test -Doptimize=ReleaseSafe
  • zig build wasm
  • zig build -Doptimize=ReleaseSafe
  • zig fmt --check build.zig gen_test.zig src/*.zig
  • PYTHONPATH=python python3 -m pytest -q python/tests (211 passed, 1 skipped)

@Lulzx
Lulzx marked this pull request as ready for review August 13, 2026 13:18
@Lulzx
Lulzx merged commit 3d36a17 into main Aug 13, 2026
4 checks passed
@Lulzx
Lulzx deleted the agent/harden-malformed-pdf-handling branch August 13, 2026 13:18
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