fix(deps): bump pdfjs-dist to 6.2.108 for GHSA-hq66-cqwq-w95j - #110
Open
MohammedAlkindi wants to merge 1 commit into
Open
fix(deps): bump pdfjs-dist to 6.2.108 for GHSA-hq66-cqwq-w95j#110MohammedAlkindi wants to merge 1 commit into
MohammedAlkindi wants to merge 1 commit into
Conversation
pdfjs-dist is pinned exactly at 6.1.200, which falls inside the range affected by GHSA-hq66-cqwq-w95j (CVE-2026-16633, high severity, arbitrary JavaScript execution on opening a malicious PDF; vulnerable >=5.6.83 <6.2.108). Because the pin is exact rather than a range, no consumer can reach a patched release through normal resolution, and npm audit's only proposed remedy is a SemVer-major downgrade to officeparser 6.0.7. The pin style is left exact, matching the deliberate choice already in place for this dependency. sync-pdfjs-versions.js could not fully propagate the bump on its own: docs/specs/debugging_fragment.html and two lines of README.md cite the version without the `pdfjs-dist@` prefix, so neither the replacement nor the unhandled-occurrence scan could see them, and the script reported success while leaving documentation pointing at the vulnerable worker. Capture the previous version before the argument overwrite and rewrite bare occurrences too, and add the debugging fragment to filesToUpdate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A clean install of
officeparser@7.5.1reports two high-severity advisories and offers no forward fix:pdfjs-distis pinned exactly at6.1.200(package.jsonline 123), and that version sits inside the range affected by GHSA-hq66-cqwq-w95j / CVE-2026-16633, published 2026-08-06. The advisory landed a week after 7.5.1 shipped, so nothing was wrong when the pin was chosen.The exact pin is what makes this awkward for consumers. A range resolves forward once a patch exists; an exact pin resolves to one version and that version is the affected one. So no downstream project can pick up
6.2.108through normal resolution — the only consumer-side remedy is an npmoverridesblock, and npm's own suggested fix is a SemVer-major downgrade toofficeparser@6.0.7. That is why I am sending a PR rather than waiting for the usual dependency sweep.What changed.
pdfjs-dist6.1.200→6.2.108, applied throughnpm run sync:versions 6.2.108.One thing that change surfaced.
sync-pdfjs-versions.jscould not fully propagate the bump. Its replacement and its unhandled-occurrence scan both key off/pdfjs-dist@[\d.]+/, butdocs/specs/debugging_fragment.html(lines 58, 60, 177) and two lines ofREADME.md(1380, 1389) cite the version as a bare6.1.200with nopdfjs-dist@prefix. The file also was not infilesToUpdate. The result was that the script printedwhile leaving three documentation references pointing at the vulnerable worker — including the debugging guide telling users which
pdfWorkerSrcCDN URL to configure. Since those docs would actively instruct people to load the affected worker, I treated it as part of this fix rather than a separate cleanup. The script now captures the previous version before the argument overwrite and rewrites bare occurrences as well, and the debugging fragment is infilesToUpdate.Deliberately unchanged. The pin stays exact rather than becoming
^6.2.108— that looked like a considered choice given the repo's history with pdfjs-dist breakage (#36, #62), and changing pinning strategy is yours to make, not mine. I also left the scan regex alone: widening it to match bare version strings would flagCHANGELOG.mdon every build, since the changelog legitimately cites historical versions, and a warning that always fires is worse than the current gap.Which internal parser/component does this affect?
If Other, please specify: n/a
Type of Change
If Other, please specify: n/a
Verification Results
Build Check:
npm run buildcompletes with no errors in Node or browser bundles. All four browser bundles build;sync:versionsnow reports 5 files updated and a clean scan.Parser Baselines: Not honestly tickable on my machine — please treat CI as the authority here.
npm testexits 1 for me, but at a pre-existing Windows-only failure unrelated to this change:I confirmed it is pre-existing by stashing this branch, reinstalling and rebuilding at unmodified
master, and re-runningtest/testShippingArtifacts.ts: byte-identical failure, same86 passed, 1 failed, same exit 1. So this PR introduces no new failures, but I cannot claim a green suite.test/testShippingArtifacts.tsappears toimport()an absolute Windows path rather than afile://URL. Happy to send that as a separate PR if it is worth fixing.Two other Windows notes, both environmental rather than defects in this change:
npm testalso needs--script-shellpointed at bash, becausesync:docsandbuild:browser:typesusemkdir -pandcp, which cmd.exe does not provide; the same applies to the husky pre-commit hook. Everything above was run withnpm_config_script_shellset to Git Bash.Manual Proof: I checked that
6.2.108is a drop-in, since a version bump is only safe if behaviour is unchanged. Sameofficeparser@7.5.1, same inputs, onlypdfjs-distdiffering:Identical extracted text on both paths. And with the bump applied,
npm auditon a fresh consumer install reportsfound 0 vulnerabilities.Checklist
pdfWorkerSrcmatchespackage.json, say the word and I will add one.Two notes on process. The
docs/dist/*changes in this diff are produced automatically by the repo's own.husky/pre-commit(npm run buildthengit add docs/dist), so the reviewable surface is really the other eight files. And I readSECURITY.mdbefore filing — since this is an already-public advisory in a transitive dependency rather than an undisclosed flaw in officeParser itself, a PR seemed more useful than a private report that would just ask you to do this work. Happy to move it if you would rather handle it through the private channel.