CVE-2023-3978 Improper rendering of text nodes in golang.org/x/net/html

Medium 6.1 Published Updated

Attackers can inject malicious scripts via improperly escaped text nodes in the Go HTML library, leading to cross-site scripting attacks.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-3978?

CVE-2023-3978 is a medium-severity cross-site scripting vulnerability in golang.org/x/net/html, published on 2 Aug 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Text nodes not in the HTML namespace are incorrectly literally rendered, causing text which should be escaped to not be. This could lead to an XSS attack.

Weakness: CWE-79

Which versions are affected by CVE-2023-3978?

3 open source packages ship an affected version, including golang.org/x/net. It affects 1 product.

PackageAffectedFixed in
golang.org/x/net GoAll versions0.13.0
golang.org/x/net GoAll versions0.13.0
golang.org/x/net GoAll versions0.13.0
Linux distribution packages (37)
podman Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-catatonit Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-catatonit-debuginfo Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-debuginfo Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-debugsource Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-docker Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-gvproxy Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-gvproxy-debuginfo Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-plugins Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-plugins-debuginfo Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-remote Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-remote-debuginfo Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman-tests Red Hat:openshift:4.14::el8All versions3:4.4.1-11.2.rhaos4.14.el8
podman Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-debuginfo Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-debugsource Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-docker Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-gvproxy Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-gvproxy-debuginfo Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-plugins Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-plugins-debuginfo Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-remote Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-remote-debuginfo Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
podman-tests Red Hat:openshift:4.14::el9All versions3:4.4.1-11.2.rhaos4.14.el9
golang SUSE:EL-9:Update:Products:ManagerTools:UpdateAll versions1.20.12-1.3.1
golang-github-lusitaniae-apache_exporter SUSE:EL-9:Update:Products:ManagerTools:UpdateAll versions1.0.8-1.14.1
scap-security-guide SUSE:EL-9:Update:Products:ManagerTools:UpdateAll versions0.1.74-1.29.1
spacecmd SUSE:EL-9:Update:Products:ManagerTools:UpdateAll versions5.0.10-1.41.1
uyuni-tools SUSE:EL-9:Update:Products:ManagerTools:UpdateAll versions0.1.23-1.11.1
golang-github-prometheus-promu SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions0.16.0-150000.3.21.4
golang-github-prometheus-promu SUSE:Linux Enterprise Module for Package Hub 15 SP6All versions0.16.0-150000.3.21.4
golang-github-lusitaniae-apache_exporter SUSE:Manager Client Tools 12All versions1.0.8-1.24.3
golang-github-prometheus-promu SUSE:Manager Client Tools 12All versions0.16.0-1.21.3
mgr-daemon SUSE:Manager Client Tools 12All versions4.3.11-1.53.2
spacecmd SUSE:Manager Client Tools 12All versions5.0.10-38.150.2
spacewalk-client-tools SUSE:Manager Client Tools 12All versions4.3.21-52.104.2
uyuni-common-libs SUSE:Manager Client Tools 12All versions5.0.5-1.45.2

Products include Golang Networking.

How do I fix CVE-2023-3978?

Upgrade golang.org/x/net to 0.13.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2023-3978 being exploited?

There is no known exploitation of CVE-2023-3978 in the wild and no public exploit code.

Sources

Also known as AZL-27810, AZL-27813, AZL-27818, AZL-27831, AZL-31690, AZL-31858 and 24 more.

Is CVE-2023-3978 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free