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

Fix to prevent XSS, throw an error when the URL contains a JS script #2464

Merged
merged 6 commits into from Oct 16, 2019

Conversation

yasuf
Copy link
Collaborator

@yasuf yasuf commented Oct 14, 2019

@yasuf yasuf changed the title XSS fix to throw errror when the URL contains a JS script Fix to prevent XSS, throw an error when the URL contains a JS script Oct 14, 2019
@snoopysecurity
Copy link

snoopysecurity commented Oct 15, 2019

Hey 👋 So the PR itself does amend the logic of isValidXss to throw an error and that makes sense. However, by looking at the logic of

var regex = RegExp('<script+.*>+.*<\/script>');
, It is very easy to bypass this validation by having a payload such as https://github.com/axios/axios?<svg/onload=alert(1)> or anything other than a script tag.

This isn't a huge problem since #2447 seems be not exploitable anyway. So this PR might be enough to stop Fortify reporting this as a vulnerability.

Hope this helps

@felipewmartins felipewmartins merged commit 29da6b2 into axios:master Oct 16, 2019
@etanxing
Copy link

Thanks guys, any plan for this release?

@felipewmartins
Copy link
Collaborator

@yasuf This merge cause a error in the main build. Please are you can see? I need this to fix the #2479

@yasuf
Copy link
Collaborator Author

yasuf commented Oct 21, 2019

what's the error? where can I see it?

edit: nevermind, found your PR

@felipewmartins
Copy link
Collaborator

@axios axios locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants