Skip to content

security: pin vendored library hashes in check-cdn-versions.sh - #21

Merged
NX1X merged 1 commit into
mainfrom
security/hardening-sept2026
Sep 7, 2026
Merged

security: pin vendored library hashes in check-cdn-versions.sh#21
NX1X merged 1 commit into
mainfrom
security/hardening-sept2026

Conversation

@NX1X

@NX1X NX1X commented Sep 6, 2026

Copy link
Copy Markdown
Owner

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/customManagers entry tracks public/vendor/. Reachability today is limited (no page.render() call, no XLSX.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
  • Verified it fails with a clear mismatch message when a byte is changed in a vendored file (manual test, reverted before commit)

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.
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
easyconvert Ready Ready Preview Sep 6, 2026 6:46pm UTC

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 350f1f77-377d-4521-b3ce-4b4394a65942


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@NX1X
NX1X merged commit 54c7b85 into main Sep 7, 2026
11 checks passed
@NX1X
NX1X deleted the security/hardening-sept2026 branch September 7, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant