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

xss in nutshell #32

Open
arxenix opened this issue Jul 6, 2023 · 0 comments
Open

xss in nutshell #32

arxenix opened this issue Jul 6, 2023 · 0 comments

Comments

@arxenix
Copy link

arxenix commented Jul 6, 2023

If nutshell processes on untrusted (but sanitized) content, there are some XSS vulnerabilities:

e.g.

<a href="x">:test&lt;img src=x onerror=alert(1)&gt;</a>

gets transformed to

<a href="x" class="nutshell-expandable" mode="closed">
<span class="nutshell-expandable-text">
test<img src="x" onerror="alert(1)">
</span>
<span class="nutshell-ball-up" style="background: rgb(0, 0, 0);"></span>
<span class="nutshell-ball-down" style="background: rgb(0, 0, 0);"></span>
</a>

there's also xss with untrusted youtube urls, e.g. the URL https://youtu.be/pQ2dI_B_Ycg?t=36"></iframe><img src=x onerror="alert(1)">

<a href='https://youtu.be/pQ2dI_B_Ycg?t=36"></iframe><img src=x onerror="alert(1)">'>:xss</a>

DOMPurify should always be run as the very last step before inserting anything into the DOM. Currently nutshell doesn't do this so there's a few ways to obtain XSS. This should fix potential issues (but also, ideally the code should be rewritten to avoid all the HTML concatention and instead use dom node/tree operations)

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

No branches or pull requests

1 participant