-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/net/html: html.Parse() panic caused by malformed data #27702
Comments
Thank you @tr3ee for reporting this issue! /cc @nigeltao @namusyaka |
CVE-2018-17142 has been assigned to this. |
@namusyaka (already @-mentioned) wrote the @bradfitz may know if we need to do anything with the CVE identifier. |
The CVE existing in a comment in this bug is sufficient (for searchability). |
Not sure if this helps, as I don't know much about the HTML parsing spec, but I was looking into this being a new contributor and trying to learn the code base... it seems like the Insertion Mode struct attribute for parser is nil, causing a nil pointer dereference error. I don't mind diving into it further to see about finding the root cause and fix it if @namusyaka wouldn't mind and isn't already working on it. EDIT: As an alternative and/or temporary fix... @tr3ee what are your thoughts on using defer, panic, recover https://blog.golang.org/defer-panic-and-recover
|
hello @NerdsvilleCEO , |
@nigeltao what do you think about doing a nil pointer check and returning an error from parseCurrentToken if p.im is nil? I know it doesn't fix it at the root of the issue but it's a start, are there any disadvantages to doing this? |
The proper fix is to not set p.im to nil in the first place. |
I can take a look at this tomorrow or in a few days |
Change https://golang.org/cl/136875 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
No panic exit
What did you see instead?
The text was updated successfully, but these errors were encountered: