Skip to content

Also find nonce in script-src-elem#612

Open
adrianbj wants to merge 14 commits intonette:masterfrom
adrianbj:nonce-script-src-elem
Open

Also find nonce in script-src-elem#612
adrianbj wants to merge 14 commits intonette:masterfrom
adrianbj:nonce-script-src-elem

Conversation

@adrianbj
Copy link
Contributor

@adrianbj adrianbj commented Feb 18, 2026

If you have onclick or other inline event handlers, you might put your nonce in script-src-elem rather than script-src. This will find either way.

  • bug fix / new feature? new feature I suppose.
  • BC break? no

@dg
Copy link
Member

dg commented Feb 20, 2026

This directive only specifies valid sources for inline script event handlers like onclick. It does not apply to other JavaScript sources that can trigger script execution, such as URLs loaded directly into <script>

https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src-attr

@adrianbj
Copy link
Contributor Author

Hi @dg - yes, I understand that. Sorry, my bad - my note might have confused you - it should say script-src-elem like the title of the PR does, rather than script-src-attr

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