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 Filter Failure in isURL (2.0) #613

Closed
aileen opened this issue Jan 6, 2017 · 4 comments
Closed

XSS Filter Failure in isURL (2.0) #613

aileen opened this issue Jan 6, 2017 · 4 comments
Labels

Comments

@aileen
Copy link

aileen commented Jan 6, 2017

I know, issue #605 is closed, but I found a similar issue (this time for real):

A URL like https://example.com/foo/<script>alert('XSS')</script>/ is a valid URL in terms of validator.isURL().

Is there a chance to fix this?

Version 6.2.0

@aileen aileen changed the title XSS Filter Failure in isURL XSS Filter Failure in isURL (2.0) Jan 6, 2017
@chriso
Copy link
Collaborator

chriso commented Jan 6, 2017

RFC 3986 states:

path = ( "/" segment )
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "
" / "+" / "," / ";" / "="

RFC 1738 states:

The characters "<" and ">" are unsafe because they are used as the delimiters around URLs in free text.

RFC 3987 says that < and > are not allowed.

tl;dr (, ) and ' are ok, but < and > are not.

I can fix this, but in general you should not be relying on the validator to suppress XSS attacks.

@chriso chriso added the 🐛 bug label Jan 6, 2017
@aileen
Copy link
Author

aileen commented Jan 6, 2017

Yeah, I see... Will not rely on the validator only.

Just wanted to point it out here! 😊

Thanks, tho!

@chriso chriso closed this as completed in eca572e Jan 6, 2017
@chriso
Copy link
Collaborator

chriso commented Jan 6, 2017

Fixed in 6.2.1

@aileen
Copy link
Author

aileen commented Jan 6, 2017

Wow! Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants