PDFME Affected by Decompression Bomb in FlateDecode Stream Parsing Causes Memory Exhaustion DoS
How AI Introduced This
Yes. AI-authored code directly introduced the vulnerable unbounded `DecodeStream.ensureBuffer()` implementation into the monorepo in `e4a4c300cd20dc34166e25565908d0a9afdb58f5`, and Devin also co-authored `3aacf2a9b1883b160db068863310f59940681d82`, which exposed the same parser through additional user-supplied PDF manipulation APIs. The original product-level exposure started earlier in a human commit, but AI code was still part of the causal chain and wrote code the fix later changed.
▶Attribution Chain
▶Bug-Introducing Commits(3)
Migrate pdf-lib into pdfme monorepo
Extracted from squash merge e4a4c30
▶14 other sub-commits in this PR
Implement comprehensive security hardening for CodeQL alerts in svg.ts
Potential fix for code scanning alert no. 32: Incomplete multi-character sanitization
Potential fix for code scanning alert no. 39: Incomplete multi-character sanitization
Fix inefficient regular expression in svg.ts to pass CodeQL
remove sanitize-html
move tests
fix for security
update dependabot.yml
organize
Fix lint errors across multiple packages
Extracted from squash merge 2eff173
Fix linting errors in packages/schemas
Extracted from squash merge c51ee07
▶4 other sub-commits in this PR
Fix type errors in multiVariableText/propPanel.ts and barcodes/helper.ts
Merge branch 'main' into devin/1741140245-fix-lint-errors
Fix PropPanelProps type error in multiVariableText/propPanel.ts
Potential fix for code scanning alert no. 14: Unsafe HTML constructed from library input
Deep Verification
by GPT-5.4`e4a4c300` added `packages/pdf-lib/src/core/streams/DecodeStream.ts` to the monorepo, including the vulnerable `ensureBuffer(requested)` implementation with unbounded growth: `while (size < requested) { size *= 2; }` followed by `new Uint8Array(size)`, with no decoded-size cap. The fix commit `8c3b6a713b3de767e1bdcc37ce831ecbce0212f3` directly modifies those lines to add `MAX_DECODED_SIZE` checks, and blame on the fixed file attributes the pre-fix vulnerable lines to `e4a4c300`. Even though this was a migration/import of existing logic, reintroducing that vulnerable implementation into repo code is bug introduction under the stated criteria.