Add subresource integrity attribute to Bootstrap CDN link#1
Open
semgrep-code-barry7985[bot] wants to merge 1 commit into
Open
Add subresource integrity attribute to Bootstrap CDN link#1semgrep-code-barry7985[bot] wants to merge 1 commit into
semgrep-code-barry7985[bot] wants to merge 1 commit into
Conversation
Add subresource integrity (SRI) attribute to the Bootstrap CSS CDN link in the account creation template to prevent potential tampering. ## Changes - Added `integrity` attribute with the sha384 hash for bootstrap@5.3.2 CSS to `accounts/templates/accounts/creation.html` - Added `crossorigin="anonymous"` attribute required for SRI validation on cross-origin resources ## Why Without the `integrity` attribute, the browser cannot verify that the externally hosted Bootstrap CSS file has not been tampered with. If an attacker compromises the CDN or performs a man-in-the-middle attack, they could inject malicious content leading to XSS or other attacks. The SRI hash ensures the browser only applies the stylesheet if its content matches the expected cryptographic hash. ## Semgrep Finding Details This tag is missing an 'integrity' subresource integrity attribute. The 'integrity' attribute allows for the browser to verify that externally hosted files (for example from a CDN) are delivered without unexpected manipulation. Without this attribute, if an attacker can modify the externally hosted resource, this could lead to XSS and other types of attacks. To prevent this, include the base64-encoded cryptographic hash of the resource (file) you're telling the browser to fetch in the 'integrity' attribute for all externally hosted files. brry00802@gmail.com requested this Autofix PR for [this finding](https://semgrep.dev/orgs/brry00802_personal_org/findings/890338735) from the detection rule [html.security.audit.missing-integrity.missing-integrity](https://semgrep.dev/r/html.security.audit.missing-integrity.missing-integrity).
Barry7985
marked this pull request as ready for review
July 15, 2026 16:55
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.
Add subresource integrity (SRI) attribute to the Bootstrap CSS CDN link in the account creation template to prevent potential tampering.
Changes
integrityattribute with the sha384 hash for bootstrap@5.3.2 CSS toaccounts/templates/accounts/creation.htmlcrossorigin="anonymous"attribute required for SRI validation on cross-origin resourcesWhy
Without the
integrityattribute, the browser cannot verify that the externally hosted Bootstrap CSS file has not been tampered with. If an attacker compromises the CDN or performs a man-in-the-middle attack, they could inject malicious content leading to XSS or other attacks. The SRI hash ensures the browser only applies the stylesheet if its content matches the expected cryptographic hash.Semgrep Finding Details
This tag is missing an 'integrity' subresource integrity attribute. The 'integrity' attribute allows for the browser to verify that externally hosted files (for example from a CDN) are delivered without unexpected manipulation. Without this attribute, if an attacker can modify the externally hosted resource, this could lead to XSS and other types of attacks. To prevent this, include the base64-encoded cryptographic hash of the resource (file) you're telling the browser to fetch in the 'integrity' attribute for all externally hosted files.
brry00802@gmail.com requested this Autofix PR for this finding from the detection rule html.security.audit.missing-integrity.missing-integrity.