Skip to content

Update nonceable attribute checks for link elements#810

Open
mikewest wants to merge 1 commit intomainfrom
mikewest-patch-1
Open

Update nonceable attribute checks for link elements#810
mikewest wants to merge 1 commit intomainfrom
mikewest-patch-1

Conversation

@mikewest
Copy link
Copy Markdown
Member

@mikewest mikewest commented Apr 8, 2026

This PR adds <link to the blocklist for nonceable elements. If we're going to keep this algorithm, it should cover all nonceable elements, not just the script and style tags.


Preview | Diff

This PR adds `<link` to the blocklist for nonceable elements. If
we're going to keep this algorithm, it should cover all nonceable
elements, not just the script and style tags.
Copy link
Copy Markdown
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it go out-of-sync with the note here:

https://w3c.github.io/webappsec-csp/#match-element-to-source-list

@mikewest
Copy link
Copy Markdown
Member Author

mikewest commented Apr 9, 2026

I think you're pointing at:

Nonces only apply to inline script and inline style, not to attributes of either element or to javascript: navigations.

This seems like it's already out of date in light of the nonce attribute work we did in HTML. Skimming the doc, there are probably a few other places we should change (https://w3c.github.io/webappsec-csp/#dangling-markup-attacks for one, and we should probably point to <link> explicitly in the style-src definition).

I'll try to wrap those changes up in a slightly larger PR.

@annevk
Copy link
Copy Markdown
Member

annevk commented Apr 9, 2026

Ah okay, I didn’t realize that. This change seems okay, but it would be good if it was all consistent.

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