GHSA-5p4h-3377-7w67 CVE-2018-17075 GO-2021-0078
golang.org/x/net/html NULL Pointer Dereference vulnerability
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 2.77%
- Chance of exploitation in the next 30 days. Higher than 86.35% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-476 NULL Pointer Dereference
- Fix
0.0.0-20180816102801-aaf60122140d- Upgrade golang.org/x/net to this version or later
Description
The html package (aka x/net/html) before 2018-07-13 in Go mishandles "in frameset" insertion mode, leading to a "panic: runtime error" for html.Parse of <template><object>, <template><applet>, or <template><marquee>. This is related to HTMLTreeBuilder.cpp in WebKit.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| golang.org/x/net | < 0.0.0-20180816102801-aaf60122140d |
0.0.0-20180816102801-aaf60122140d |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
golang.org/x/net Go → 0.0.0-20180816102801-aaf60122140d
- go
go get golang.org/x/net@v0.0.0-20180816102801-aaf60122140d && go mod tidy
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-476: NULL Pointer Dereference
The product dereferences a pointer that it expects to be valid but is NULL.
How to prevent it
- Implementation: For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
- Requirements: Select a programming language that is not susceptible to these issues.
- Implementation: Check the results of all functions that return a value and verify that the value is non-null before acting upon it.
- Architecture and Design: Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.
- Implementation: Explicitly initialize all variables and other data stores, either during declaration or just before the first usage.
References
Advisories
Packages
Other links
- github.com/golang/go/issues/27016
- github.com/golang/net/commit/aaf60122140d3fcf75376d319f0554393160eb50
- bugs.chromium.org/p/chromium/issues/detail
- go-review.googlesource.com/c/net/+/94838/9/html/parse.go
- go.dev/cl/123776
- go.dev/issue/27016
- go.googlesource.com/net/+/aaf60122140d3fcf75376d319f0554393160eb50
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LREEW…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UKRCI…
- pkg.go.dev/vuln/GO-2021-0078
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-4374-p667-p6c8 HTTP/2 rapid reset can cause excessive work in net/http | High Known exploited | Also affects golang.org/x/net |
| GHSA-qppj-fm5r-hxr3 HTTP/2 Stream Cancellation Attack | Medium Known exploited | Also affects golang.org/x/net |
| GO-2026-6866 Check all ancestor namespace transitions when rendering raw text in html in golang.org/x/net | Not rated yet | Also affects golang.org/x/net |
| GO-2026-6860 Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net | Not rated yet | Also affects golang.org/x/net |
| GO-2026-6617 HTTP/2 server crash due to HPACK encoder race in net/http | High | Also affects golang.org/x/net |
| GO-2026-6612 Double flow control refund on HTTP/2 server streams in net/http | Critical | Also affects golang.org/x/net |
| GO-2026-6611 Excessive CPU consumption from repeated initial window changes in net/http | High | Also affects golang.org/x/net |
| GO-2026-6610 HTTP/2 transport accepts malformed framing-related headers in net/http | High | Also affects golang.org/x/net |
Credits: Kunpei Sakai
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor