Add SRI hash to the Redoc CDN script in docs/index.html#44
Open
dmchaledev wants to merge 1 commit into
Open
Conversation
The public API docs page loads redoc.standalone.js from jsdelivr with no subresource-integrity check, so a CDN compromise could silently inject arbitrary JS into a HailBytes-branded page — the kind of supply-chain exposure our own ASM product flags for customers. Pin the script with a sha384 integrity hash (verified against jsdelivr's own published hash for the pinned 2.5.3 build) plus crossorigin="anonymous". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012noANQjQLjeAESfbo89RoL
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
docs/index.htmlloads Redoc from jsdelivr (redoc@2.5.3/bundles/redoc.standalone.js) with no Subresource Integrity check. If the CDN (or the pinned package release) were ever compromised, arbitrary JS could run on our public API docs page unnoticed — the same class of supply-chain risk HailBytes ASM flags for customers.sha384integrityattribute pluscrossorigin="anonymous"to the<script>tag, so the browser refuses to execute the file if its bytes ever don't match this exact pinned version.2.5.3release — they match.Test plan
sha256of the downloadedredoc.standalone.jsmatches jsdelivr's own published hash forredoc@2.5.3(confirms the correct bytes were hashed).sha384SRI value from the same file for theintegrityattribute.🤖 Generated with Claude Code
https://claude.ai/code/session_012noANQjQLjeAESfbo89RoL
Generated by Claude Code