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 injection vulnerability using empty, undelimited attributes #19

Closed
jimmed opened this issue Jul 17, 2014 · 3 comments · Fixed by #20
Closed

XSS injection vulnerability using empty, undelimited attributes #19

jimmed opened this issue Jul 17, 2014 · 3 comments · Fixed by #20

Comments

@jimmed
Copy link

jimmed commented Jul 17, 2014

Entering the following:

<IMG SRC= onmouseover="alert('XSS');">

produces the following:

<img src="onmouseover="alert('XSS');"" />

This is definitely invalid HTML, but would suggest that it's being interpreted incorrectly by the parser. I would expect:

<img src="" />
@boutell
Copy link
Member

boutell commented Jul 17, 2014

Hmm, is this a bug in HTMLParser2?

On Thu, Jul 17, 2014 at 10:45 AM, jimmed notifications@github.com wrote:

Entering the following:

<IMG SRC= onmouseover="alert('XSS');">

produces the following:

<img src="onmouseover="alert('XSS');"" />

This is definitely invalid HTML, but would suggest that it's being
interpreted incorrectly by the parser. I would expect:


Reply to this email directly or view it on GitHub
#19.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@boutell
Copy link
Member

boutell commented Jul 17, 2014

I am surprised that this doesn't show up as two attributes in the data
we're getting from the parser.

One way we can deal, though, is by making sure there are no unescaped
double quotes allowed to come through in an attribute.

On Thu, Jul 17, 2014 at 11:06 AM, Tom Boutell tom@punkave.com wrote:

Hmm, is this a bug in HTMLParser2?

On Thu, Jul 17, 2014 at 10:45 AM, jimmed notifications@github.com wrote:

Entering the following:

<IMG SRC= onmouseover="alert('XSS');">

produces the following:

<img src="onmouseover="alert('XSS');"" />

This is definitely invalid HTML, but would suggest that it's being
interpreted incorrectly by the parser. I would expect:


Reply to this email directly or view it on GitHub
#19.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@jimmed
Copy link
Author

jimmed commented Jul 18, 2014

Closed this issue, see pull request #20

@jimmed jimmed closed this as completed Jul 18, 2014
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

Successfully merging a pull request may close this issue.

2 participants