LibWeb: Track if element was created from token with dupe attributes

This is required for CSP to ignore the nonce attribute to prevent
duplicate attributes hijacking the attribute.

See https://w3c.github.io/webappsec-csp/#security-nonce-hijacking
This commit is contained in:
Luke Wilde 2024-12-02 12:33:52 +00:00 committed by Andrew Kaster
commit 2368641de5
Notes: github-actions[bot] 2025-07-09 21:54:13 +00:00
5 changed files with 27 additions and 0 deletions

View file

@ -4067,4 +4067,9 @@ bool Element::should_indicate_focus() const
return false;
}
void Element::set_had_duplicate_attribute_during_tokenization(Badge<HTML::HTMLParser>)
{
m_had_duplicate_attribute_during_tokenization = true;
}
}