Security: Content Security Policy Allows Unsafe Inline Styles#1875
Open
tomaioo wants to merge 1 commit into
Open
Security: Content Security Policy Allows Unsafe Inline Styles#1875tomaioo wants to merge 1 commit into
tomaioo wants to merge 1 commit into
Conversation
The CSP in `resources/html/reactView.html` allows `'unsafe-inline'` in `style-src` and also allows `blob:`, `http:`, `https:`, and `data:` for styles. This weakens the CSP protection and could allow injection of malicious styles or other content. Additionally, `script-src` only uses `{{cspSource}}` without a nonce, which may be insufficient depending on how `cspSource` is constructed.
Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
tomaioo
requested review from
Blastoplex,
amarg-at,
bwieger-atlassian-com,
cabella-dot,
ccallcottstevens,
cindy-atl,
dchiew-atl,
jwang19-atlassian,
marcomura,
matt-lassian,
mattcolman,
sdzh-atlassian and
teg-atlassian
as code owners
June 15, 2026 06:31
|
Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution. Already signed the CLA? To re-check, try refreshing the page. |
Contributor
|
To enable Rovo Dev code reviews, link your GitHub account to your Atlassian account. This is a one-time task that takes less than a minute. Once your account is linked, resubmit the pull request to trigger a code review. |
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
Security: Content Security Policy Allows Unsafe Inline Styles
Problem
Severity:
Medium| File:resources/html/reactView.html:L12The CSP in
resources/html/reactView.htmlallows'unsafe-inline'instyle-srcand also allowsblob:,http:,https:, anddata:for styles. This weakens the CSP protection and could allow injection of malicious styles or other content. Additionally,script-srconly uses{{cspSource}}without a nonce, which may be insufficient depending on howcspSourceis constructed.Solution
Remove
'unsafe-inline'from style-src if possible, or use a nonce-based approach for styles. Restrict thestyle-srcdirective to only necessary sources. Consider adding a nonce to script-src as done in reactWebview.html.Changes
resources/html/reactView.html(modified)Rovo Dev code review: Rovo Dev couldn't review this pull request
The pull request author does not have access to Rovo Dev.