-
Notifications
You must be signed in to change notification settings - Fork 707
[css-values] Keylogging concerns for attr() value #2339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmmm... value of attribute shouldn't be affected by input at all. This seems invalid, and I cannot reproduce keylogging with the proposed method from the poc. |
So that POC relies on component frameworks like React, which seems to put the value inputted by user back to the value attribute, which caused the keylogging issue. In that case, |
The [value] is static but must be specified that ::after and ::before are forbidden for input. It is good reason why not to use react etc. Why ::before must be locked for input? ::before will create anonymous div that can load specified font and the width of block can be checked. |
@upsuper attr() can't be used for anything nefarious today, but if we add a string-concat function, it lets you trivially exfiltrate any attribute value from an element with something like But then again, we already know that allowing people to run arbitrary CSS on your site is an XSS vector. It takes a little more effort than just running arbitrary script, but there have been several reasonable POCs written over the years. The linked article describes using attribute selectors for this purpose, which does work today but requires an exponential explosion of selectors to get something useful. Weak password exfiltration might be reasonable, particularly since using a combination of |
Hmmm, if you can insert a sheet on a host you controlled, e.g. inserting
It's a bit surprising to me. I didn't think CSS could be used for XSS... Have we put anything about this in CSS spec somehow?
It's more than that, really. If you type the password, |
If you control the host, you can already do whatever you want. I don't think that's an attack scenario we have to worry about. ^_^ Because yeah, the best that
Ah, indeed, that's clever. (Tho again, it only works against things like React that spam the value property into the value attribute.) |
I mean you insert a sheet which is served from a host you controlled. I don't think that's the same as controlling the host which serves the page. |
I think that requires full XSS power to do? (As in, if you can insert arbitrary s, you can already own the page.) Unless @import is around, hmm. Point stands - CSS is already in many ways as dangerous of an XSS vector as JS. If you're allowing arbitrary CSS you're screwed. |
w3c/webappsec-csp#45 is somewhat relevant here. Giving sites more fine-grained control over what CSS can be inserted. |
|
See https://github.com/maxchehab/CSS-Keylogging for an interesting poc how using pure CSS to do keylogging. I suspect
attr()
value would have way larger potential to enable a more powerful CSS keylogger.The text was updated successfully, but these errors were encountered: