Repository navigation
fix: make the vendored pdf.js auditable - #360
Merged
Merged
Conversation
js/vendor/pdfjs holds a built, locally patched copy of PDF.js 2.10.0. Its version string still reads 2.10.0, and the CVE-2024-4367 backport applied in commit 3358e60 was recorded nowhere outside the patched files - so the version string overstates the risk while nothing revealed the real patch level. Bower is unmaintained and Dependabot has never supported it, and the copy carried no manifest, so no scanner listed pdf.js at all. Add js/vendor/pdfjs/PATCHES.md recording the upstream version and build id, the applied backport with its commit, and the audit of every published pdfjs-dist advisory against 2.10.0: CVE-2024-4367 applies and is backported; CVE-2026-16633 (>= 5.6.83) and CVE-2018-5158 (< 2.0.550) do not. Nothing is unpatched. Add js/vendor/pdfjs/package.json so scanners and SBOM tooling can see the library. Verified with Trivy: the dist tree now reports js/vendor/pdfjs/package.json as pdfjs-dist 2.10.0, where previously nothing was detected. The cost is one false positive - a scanner keyed on the version reports the backported CVE-2024-4367 - so .trivyignore accepts exactly that advisory and points at PATCHES.md. Verified against the reusable trivy workflow's invocation (working directory = repository root, scan target = dist tree): exit 0 with the ignore file, exit 1 without it. Anchor the composer `vendor/` gitignore rule to the project root. Left unanchored it also matched js/vendor/, so these new files were ignored until added with -f; commit d944e5b anchored the other root-only rules but missed this one. Root vendor/ stays ignored. Remove the inert dependabot.yml from the repository root. GitHub only reads .github/dependabot.yml, and the two disagreed on schedule and PR limit. Refs: owncloud/core#41824 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
phil-davis
approved these changes
Sep 9, 2026
Closed
Merged
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.
Dependency audit for this app, a precondition for the re-release tracked in owncloud/core#41824.
What I found
js/vendor/pdfjs/holds a built and locally patched copy of PDF.js. Three things made it unauditable:pdfjsVersionreads2.10.0, but the copy is patched. CVE-2024-4367 was backported in commit3358e60(fix: mitigate CVE-2024-4367 FontMatrix code injection in pdf viewer #351) and recorded nowhere outside the patched files. So the version string overstates the risk, while nothing revealed the real patch level. That is the worst of both worlds: a scanner keyed on the version cries wolf, and a human auditing by version cannot tell what is actually fixed.pdf.jsnever appeared in any inventory of what this app ships. Bower has been unmaintained since 2017 and Dependabot has never supported it, so nothing watchedpdfjs: ~2.10.xeither..gitignorewas hiding the directory. The composer rulevendor/was unanchored, so it also matchedjs/vendor/. New files there were silently ignored unless added withgit add -f.Audit result: nothing is unpatched
Every published
pdfjs-distadvisory, checked against 2.10.0 (GitHub Advisory Database, 2026-09-09):<= 4.1.3923358e60>= 5.6.83, < 6.2.108>= 2.0.0, < 2.0.550,< 1.10.100So this needs no security work — only a record and some visibility.
Changes
js/vendor/pdfjs/PATCHES.md— upstream version and build id, the applied backport with its commit, the audit table above, and how to regenerate. It states plainly that the version string cannot be trusted on its own.js/vendor/pdfjs/package.json— so scanners and SBOM tooling can inventory the library..trivyignore— accepts exactly CVE-2024-4367, with the justification and a pointer toPATCHES.md..gitignore— anchor the composer rule to/vendor/.dependabot.yml— GitHub only reads.github/dependabot.yml; the two disagreed on schedule and PR limit, so the root file was dead config.On the manifest and the ignore file
Adding the manifest deliberately trades one false positive for real visibility. Verified with Trivy, mirroring how
reusable-workflows/.github/workflows/trivy.ymlinvokes it — working directory = repository root, scan target = the built dist tree:pdfjs-dist 2.10.0, CVE-2024-4367 HIGH, exit 1 — would failsecurity-scan.trivyignoreBeing listed with a documented, reviewable exception is worth more than not being listed. The ignore entry is scoped to the single advisory, not the package or the severity, so any new pdf.js advisory still fails the scan.
Not in this PR
The version bump to 1.1.2 is separate, so this can be reviewed on its merits and the release timed independently.
Upgrading pdf.js 2.10 → 5.x is deferred and worth tracking on its own: it is a breaking change to the API, the viewer layout and the build variants, and it would replace bower with the prebuilt
pdfjs-distnpm package — which is also what would finally let Dependabot watch this.PATCHES.mdrecords that as the durable fix. It does not belong in a patch release, since it changes whatmake distconsumes.🤖 Generated with Claude Code