security: pin vendored library hashes in check-cdn-versions.sh - #21
Merged
Conversation
The vendoring of pdf.js/SheetJS off cdnjs dropped SRI, and the version check that replaced it only verified the three files existed and were referenced by name - it never checked content. A tampered vendor file (bad merge, compromised local write, mismatched copy) passed CI green. Pin the current sha256 of each vendored file and verify it on every run; a mismatch now fails the check with the actual vs expected hash.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Summary
Vendoring pdf.js/SheetJS off cdnjs dropped SRI, and the version check that replaced it only verified the three vendor files exist and are referenced by name - it never checked content. A tampered vendor file (bad merge, compromised local write, mismatched copy) would pass CI green.
Pin the current sha256 of each vendored file (
public/vendor/pdf.min.js,pdf.worker.min.js,xlsx.full.min.js) and verify it on every run; a mismatch fails the check with the actual vs expected hash. Bump the pinned hash deliberately alongside a version update.Not changed (flagged, not fixed)
The vendored libraries themselves are stale (pdf.js 3.11.174 from Nov 2023, SheetJS 0.18.5 from Mar 2022) and, since vendoring, invisible to Renovate - no
regexManagers/customManagersentry trackspublic/vendor/. Reachability today is limited (nopage.render()call, noXLSX.read()call, so the two most relevant CVE classes aren't on a live path), so I didn't blind-bump major versions without being able to test PDF rendering/XLSX parsing end-to-end. Worth a deliberate, tested upgrade pass separately.Test plan
bash scripts/check-cdn-versions.sh- passes against the current vendored files