CVE-2023-29406 Insufficient sanitization of Host header in net/http

Medium 6.5 Published Updated

A malicious Host header in Go's net/http client can inject headers or requests, requiring an upgrade to the Go standard library.

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-29406?

CVE-2023-29406 is a medium-severity vulnerability in Golang Go, published on 11 Jul 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

The HTTP/1 client does not fully validate the contents of the Host header. A maliciously crafted Host header can inject additional headers or entire requests. With fix, the HTTP/1 client now refuses to send requests containing an invalid Request.Host or Request.URL.Host value.

Weakness: CWE-436

Which versions are affected by CVE-2023-29406?

2 open source packages ship an affected version, including golang and stdlib. It affects 1 product.

PackageAffectedFixed in
golang BitnamiAll versions1.19.11, 1.20.6
stdlib GoAll versions1.19.11, 1.20.6
Linux distribution packages (38)
aardvark-dns AlmaLinux:8All versions2:1.0.1-38.module_el8.9.0+3627+db8ec155
buildah AlmaLinux:8All versions1:1.24.6-7.module_el8.9.0+3627+db8ec155
buildah AlmaLinux:8All versions1:1.24.6-7.module_el8.9.0+3687+dcd7ef8f
buildah-tests AlmaLinux:8All versions1:1.24.6-7.module_el8.9.0+3627+db8ec155
buildah-tests AlmaLinux:8All versions1:1.24.6-7.module_el8.9.0+3687+dcd7ef8f
cockpit-podman AlmaLinux:8All versions46-1.module_el8.7.0+3344+5bcd850f
conmon AlmaLinux:8All versions2:2.1.4-2.module_el8.9.0+3627+db8ec155
conmon AlmaLinux:8All versions2:2.1.4-2.module_el8.9.0+3687+dcd7ef8f
container-selinux AlmaLinux:8All versions2:2.205.0-3.module_el8.9.0+3687+dcd7ef8f
containernetworking-plugins AlmaLinux:8All versions1:1.1.1-5.module_el8.9.0+3627+db8ec155
containernetworking-plugins AlmaLinux:8All versions1:1.1.1-5.module_el8.9.0+3687+dcd7ef8f
containers-common AlmaLinux:8All versions2:1-38.module_el8.9.0+3627+db8ec155
crit AlmaLinux:8All versions3.15-3.module_el8.6.0+2877+8e437bf5
crit AlmaLinux:8All versions3.15-3.module_el8.6.0+3137+d33c3efb
criu AlmaLinux:8All versions3.15-3.module_el8.6.0+2877+8e437bf5
criu AlmaLinux:8All versions3.15-3.module_el8.6.0+3137+d33c3efb
criu-devel AlmaLinux:8All versions3.15-3.module_el8.6.0+2877+8e437bf5
criu-devel AlmaLinux:8All versions3.15-3.module_el8.6.0+3137+d33c3efb
criu-libs AlmaLinux:8All versions3.15-3.module_el8.6.0+2877+8e437bf5
criu-libs AlmaLinux:8All versions3.15-3.module_el8.6.0+3137+d33c3efb
crun AlmaLinux:8All versions1.8.7-1.module_el8.9.0+3683+33eb0feb
fuse-overlayfs AlmaLinux:8All versions1.9-2.module_el8.9.0+3627+db8ec155
fuse-overlayfs AlmaLinux:8All versions1.9-2.module_el8.9.0+3687+dcd7ef8f
libslirp AlmaLinux:8All versions4.4.0-1.module_el8.6.0+2877+8e437bf5
libslirp AlmaLinux:8All versions4.4.0-1.module_el8.6.0+3137+d33c3efb
libslirp-devel AlmaLinux:8All versions4.4.0-1.module_el8.6.0+2877+8e437bf5
libslirp-devel AlmaLinux:8All versions4.4.0-1.module_el8.6.0+3137+d33c3efb
netavark AlmaLinux:8All versions2:1.0.1-38.module_el8.9.0+3627+db8ec155
oci-seccomp-bpf-hook AlmaLinux:8All versions1.2.5-2.module_el8.8.0+3468+16b86c82
podman AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3627+db8ec155
podman AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3687+dcd7ef8f
podman-catatonit AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3627+db8ec155
podman-catatonit AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3687+dcd7ef8f
podman-docker AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3627+db8ec155
podman-gvproxy AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3627+db8ec155
podman-gvproxy AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3687+dcd7ef8f
podman-plugins AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3627+db8ec155
podman-remote AlmaLinux:8All versions2:4.0.2-24.module_el8.9.0+3627+db8ec155

Products include Golang Go.

How do I fix CVE-2023-29406?

Upgrade golang to a fixed version for your release line: 1.19.11 or 1.20.6.

Is CVE-2023-29406 being exploited?

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

Public exploit code: 1 proofs of concept on GitHub.

All Golang Go vulnerabilities

Sources

Also known as ALSA-2023:7202, AZL-27410, AZL-28831, AZL-37418, AZL-37420, AZL-52711 and 24 more.

Is CVE-2023-29406 in your software?

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

Check your SBOMs for free