Use CSP nonce instead of unsafe-inline #311
mirvnillith
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
Thanks for the proposal - makes sense. I will try to get the script Edit: note to myself: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(I looked into contributing this myself but given how this would require interconnecting changes in, at least, phoss-smp and ph-oton I did not want to risk it)
There should be some kind of context to allow phoss-smp to use CSP nonce for inline scripts instead of the discouraged unsafe-inline used today. They way we're currently deploying phoss-smp access is through a proxy to target a specific Kubernetes pod in an otherwise fully clustered environment and that adds a second CSP header that gets used instead (being more restrictive than unsafe-inline). Hopefully nonce would rectify this, although the CSP "most restrictive" resolution process is not strictly defined).
I see that CSP2SourceList (ph-web) supports nonce, but what seems to be missing is a way to convey the per-request value from SMPApplicationXServletHandler (phoss-smp), where it would be added to the CSP, to AbstractHCScriptInline? (ph-oton) to be rendered into script-tags.
Beta Was this translation helpful? Give feedback.
All reactions