---
id: CVE-2018-17847
aliases:
  - GHSA-4r78-hx75-jjj2
  - CVE-2018-17848
  - GHSA-mv93-wvcp-7m7r
  - GO-2022-0197
title: >-
  golang.org/x/net/html has Improper Restriction of Operations within the Bounds
  of a Memory Buffer
summary: >-
  golang.org/x/net/html has Improper Restriction of Operations within the Bounds
  of a Memory Buffer
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'
vendor: x
product: golang.org/x/net
ecosystem: go
affected:
  - golang.org/x/net < 0.0.0-20190125002852-4b62a64f59f7
patched:
  - golang.org/x/net 0.0.0-20190125002852-4b62a64f59f7
published: '2022-05-13'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:49:19.734133928Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-4r78-hx75-jjj2'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2018-17847'
  - url: 'https://github.com/golang/go/issues/27846'
  - url: 'https://github.com/golang/go'
  - url: 'https://go.dev/cl/159397'
  - url: 'https://go.dev/issue/27846'
  - url: 'https://go.googlesource.com/net/+/4b62a64f59f73840b9ab79204c94fee61cd1ba2c'
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LREEWY6KNLHRWFZ7OT4HVLMVVCGGUHON
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UKRCI7WIOCOCD3H7NXWRGIRABTQOZOBK
  - url: 'https://pkg.go.dev/vuln/GO-2022-0197'
tags:
  - osv
  - go
epss: 0.02364
epssPercentile: 0.82888
ingestedAt: '2026-09-12T03:13:01.753Z'
---

## Overview

The html package (aka `x/net/html`) through 2018-09-25 in Go mishandles `<svg><template><desc><t><svg></template>`, leading to a `panic: runtime error` (index out of range) in `(*nodeStack).pop` in node.go, called from `(*parser).clearActiveFormattingElements`, during an `html.Parse` call.

## Affected packages

- `golang.org/x/net < 0.0.0-20190125002852-4b62a64f59f7`

## Remediation

Upgrade to a patched release:

- `golang.org/x/net 0.0.0-20190125002852-4b62a64f59f7`
