Skip to content

Add Subresource Integrity hashes for FFmpeg WASM CDN resources (Issue #1703) - #1715

Open
anshul23102 wants to merge 1 commit into
magic-peach:mainfrom
anshul23102:fix/1703-sri-hash
Open

Add Subresource Integrity hashes for FFmpeg WASM CDN resources (Issue #1703)#1715
anshul23102 wants to merge 1 commit into
magic-peach:mainfrom
anshul23102:fix/1703-sri-hash

Conversation

@anshul23102

Copy link
Copy Markdown
Contributor

Summary

Implements cryptographic verification (SRI) for all FFmpeg WASM and JavaScript files loaded from cdn.jsdelivr.net. This prevents CDN tampering attacks and ensures resource integrity.

Changes

  • Restructured SRI_HASHES to support both UMD (v0.12.10) and ESM (v0.12.6) versions
  • Updated fetchWithIntegrity to validate against versioned hashes
  • Covers all three resource types: ffmpeg-core.js, ffmpeg-core.wasm, ffmpeg-core.worker.js
  • Strict validation: throws error if SRI hash is missing instead of falling back

Security Benefits

✅ Prevents CDN tampering attacks
✅ Cryptographic verification of all loaded content
✅ Compliant with security best practices for third-party resources

Fixes #1703

Testing

  • Build passes locally
  • TypeScript strict mode checks pass
  • SRI hashes computed for all supported versions

Fixes magic-peach#1703

Implements SRI (Subresource Integrity) verification for all FFmpeg WASM and JavaScript files loaded from cdn.jsdelivr.net. Prevents tampering with CDN-served resources and ensures cryptographic verification of loaded content.

Changes:
- Restructured SRI_HASHES to support both UMD (v0.12.10) and ESM (v0.12.6) versions
- Updated fetchWithIntegrity to validate against versioned hashes
- Added verification for ffmpeg-core.js, ffmpeg-core.wasm, and ffmpeg-core.worker.js
- Throws error if SRI hash is missing instead of silently falling back

All CDN resources now load with integrity verification enabled.
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

@anshul23102 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @anshul23102!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@anshul23102

Copy link
Copy Markdown
Contributor Author

Hi @magic-peach team! 👋

I've implemented the security fix for Issue #1703 (SRI hashes for CDN resources).

What's Included

✅ SRI verification for ffmpeg-core.js, ffmpeg-core.wasm, ffmpeg-core.worker.js
✅ Support for both UMD (v0.12.10) and ESM (v0.12.6) versions
✅ Strict validation with cryptographic verification
✅ Prevents silent fallback for unsigned content

For Review

When reviewing, labels valuable for GSSoC 2026:

  • gssoc-approved (essential for GSSoC 2026 credit)
  • security (adds SRI verification)
  • dependencies (affects CDN resource loading)

Ready for review! 🚀


Contributed as part of GSSoC 2026

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Format Issues — @anshul23102

Please fix the following before your PR can be reviewed:

  • ⚠️ Use a conventional PR title. Examples:
    • feat: add dark mode support
    • fix: resolve aria label missing on slider
    • docs: add deployment guide to README

Push new commits after fixing — this comment will update automatically.

📖 CONTRIBUTING.md

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix type:security Security type:testing Testing labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:beginner Beginner level - 20 pts type:bug Bug fix type:security Security type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FFmpeg WASM loaded from cdn.jsdelivr.net without Subresource Integrity hash - CDN compromise executes arbitrary code client-side

1 participant