Skip to content

Conversation

@jroark-envoy
Copy link

@jroark-envoy jroark-envoy commented Jan 20, 2026

Summary

This PR adds comprehensive Subresource Integrity (SRI) support to the Webflow website to protect against CDN compromises and ensure script integrity. SEC-34200

Changes:

  • generate-sri.js: Node.js script that generates SHA-384 hashes for all JS/CSS files
  • sri-hashes.json: JSON file containing all current SRI hashes for version 59 (auto-generated)
  • GitHub Actions: Updated auto-tag workflow to automatically generate SRI hashes on each version increment
  • README: Added comprehensive documentation on SRI usage, benefits, and implementation
  • .gitignore: Added to exclude temporary build artifacts

Security Benefits:

  • Protects against CDN compromises and man-in-the-middle attacks
  • Ensures the exact files tested are what users receive
  • Follows OWASP and W3C security best practices

Test plan

  • Verify generate-sri.js script runs successfully and generates valid SHA-384 hashes
  • Confirm sri-hashes.json contains hashes for all JS/CSS files in src/
  • Test GitHub Actions workflow to ensure it generates SRI hashes on push
  • Update Webflow custom code settings with SRI-enabled script tags (example provided in README)
  • Verify scripts load correctly in Webflow with integrity attributes
  • Confirm scripts fail to load if integrity hash is incorrect (security test)

Next Steps After Merge:

  1. Update Webflow custom code settings with SRI hashes from sri-hashes.json
  2. Test all script functionality in Webflow with new SRI-enabled tags
  3. Monitor for any integrity errors in browser console

🤖 Generated with Claude Code

This PR adds comprehensive SRI support to protect against CDN compromises and ensure script integrity:

- Added generate-sri.js script to generate SHA-384 hashes for all JS/CSS files
- Generated sri-hashes.json with all current SRI hashes for version 59
- Updated GitHub Actions workflow to auto-generate SRI hashes on each version increment
- Updated README with detailed SRI usage instructions and examples
- Added .gitignore to exclude temporary build artifacts

Security benefits:
- Protects against CDN compromises and MITM attacks
- Ensures exact files are delivered to users
- Follows security best practices for external resources

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit adds full automation for deploying scripts to Webflow, eliminating
the need for manual updates to the Webflow custom code settings.

Changes:
- Add deploy-to-webflow.js: Node.js script to deploy scripts via Webflow API
  - Registers hosted scripts with SRI integrity hashes
  - Applies scripts to site with proper attributes
  - Publishes the Webflow site automatically

- Update GitHub Action workflow (.github/workflows/auto-tag.yml):
  - Add new step to deploy to Webflow after tagging
  - Uses WEBFLOW_API_TOKEN and WEBFLOW_SITE_ID secrets
  - Fully automated deployment on push to main

- Add WEBFLOW_SETUP.md: Complete setup guide for Webflow API integration
  - Instructions for creating API tokens with required scopes
  - How to configure GitHub Secrets
  - Script configuration guide
  - Troubleshooting tips

- Update README.md:
  - Document the automated deployment workflow
  - Update SRI section to reflect automatic updates
  - Add references to setup documentation

Benefits:
- Eliminates manual Webflow custom code updates
- Automatic SRI hash updates for improved security
- Reduces deployment time from minutes to seconds
- Prevents human error in version/hash mismatches

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants