Add SRI hashes to external CDN script and link tags#7041
Open
arijitroy003 wants to merge 1 commit into
Open
Conversation
Add integrity="sha384-..." and crossorigin="anonymous" attributes to all external resources loaded from api.mapbox.com and cdn.jsdelivr.net in the default layout. This prevents tampering with third-party scripts and stylesheets served from CDNs (supply-chain attack mitigation). Resources covered: - mapbox-gl.css (v3.17.0-beta.1) - mapbox-gl.js (v3.17.0-beta.1) - swiper-bundle.min.css (@12) - swiper-bundle.min.js (@12)
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
Adds Subresource Integrity (SRI) hashes to all external CDN resources loaded in
_layouts/default.html:mapbox-gl.css(v3.17.0-beta.1) from api.mapbox.commapbox-gl.js(v3.17.0-beta.1) from api.mapbox.comswiper-bundle.min.css(@12) from cdn.jsdelivr.netswiper-bundle.min.js(@12) from cdn.jsdelivr.netEach tag now includes
integrity="sha384-..."andcrossorigin="anonymous"attributes. This ensures the browser verifies the fetched resource against the expected hash before executing it, mitigating supply-chain attacks where a CDN serves tampered content._layouts/docu.htmlwas also reviewed and contains no external CDN resources.Test plan
page.body_class contains "duckcon")