Skip to content

Audit PDF decompression resource bounds #8

Description

@FHoffarth

Follow-up from #6.

This is not a claim that a vulnerability exists. It is an investigation with a
measurement step before any design step.

Scope

FilePass budgets PNG metadata decompression directly: one DecompressionBudget per file,
16 MiB total, enforced in src/core/png.ts. PDF parsing has no equivalent. pdf.ts and
verify-pdf.ts contain no decompression call of their own — the work happens inside
pdf-lib and pdfjs-dist, outside FilePass's own resource accounting. Whether that is
reachable, bounded by the libraries themselves, or a real gap is unknown.

Known bound today: the 50 MB input ceiling in sniff.ts. That caps the compressed input,
not what it expands to.

Done when

  • the PDF decompression paths FilePass actually reaches are mapped — inspection, cleaning,
    the independent pdfjs-dist check, and the raw-byte backstop each count separately;
  • existing library and browser limits are identified rather than assumed absent;
  • adversarial cases are constructed only for reachable paths;
  • the cost is measured before any architecture is proposed;
  • the outcome is classified as one of: no issue / bounded risk / real gap;
  • if a real gap turns out to be broader than a surgical fix, stop and scope a separate
    design instead of expanding this one.

Explicitly out of scope

  • crawler-style fuzzing dumps;
  • replacing pdf-lib or pdfjs-dist merely because they are dependencies;
  • generalising the PNG budget into a global resource framework before evidence justifies it.

Severity

P2 investigation initially. Re-classify on findings.

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions