CVE-2025-47906 Unexpected paths returned from LookPath in os/exec

Medium 6.5 Published Updated

Attackers can bypass path restrictions in Go's os/exec LookPath if PATH contains executable files, potentially executing unintended binaries.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-47906?

CVE-2025-47906 is a medium-severity path traversal vulnerability in Golang Go, published on 18 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

If the PATH environment variable contains paths which are executables (rather than just directories), passing certain strings to LookPath ("", ".", and ".."), can result in the binaries listed in the PATH being unexpectedly returned.

Which versions are affected by CVE-2025-47906?

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

PackageAffectedFixed in
golang BitnamiAll versions1.23.12, 1.24.6
stdlib GoAll versions1.23.12, 1.24.6
Linux distribution packages (29)
go-filesystem AlmaLinux:9All versions3.6.0-12.el9_7
go-rpm-macros AlmaLinux:9All versions3.6.0-12.el9_7
go-rpm-templates AlmaLinux:9All versions3.6.0-12.el9_7
go-srpm-macros AlmaLinux:9All versions3.6.0-12.el9_7
go-filesystem Red Hat:enterprise_linux:9::appstreamAll versions0:3.6.0-12.el9_7
go-rpm-macros Red Hat:enterprise_linux:9::appstreamAll versions0:3.6.0-12.el9_7
go-rpm-macros-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:3.6.0-12.el9_7
go-rpm-macros-debugsource Red Hat:enterprise_linux:9::appstreamAll versions0:3.6.0-12.el9_7
go-rpm-templates Red Hat:enterprise_linux:9::appstreamAll versions0:3.6.0-12.el9_7
go-srpm-macros Red Hat:enterprise_linux:9::appstreamAll versions0:3.6.0-12.el9_7
go-filesystem Red Hat:rhel_e4s:9.0::appstreamAll versions0:3.0.9-12.el9_0
go-rpm-macros Red Hat:rhel_e4s:9.0::appstreamAll versions0:3.0.9-12.el9_0
go-rpm-templates Red Hat:rhel_e4s:9.0::appstreamAll versions0:3.0.9-12.el9_0
go-srpm-macros Red Hat:rhel_e4s:9.0::appstreamAll versions0:3.0.9-12.el9_0
go-filesystem Red Hat:rhel_e4s:9.2::appstreamAll versions0:3.2.0-2.el9_2
go-rpm-macros Red Hat:rhel_e4s:9.2::appstreamAll versions0:3.2.0-2.el9_2
go-rpm-templates Red Hat:rhel_e4s:9.2::appstreamAll versions0:3.2.0-2.el9_2
go-srpm-macros Red Hat:rhel_e4s:9.2::appstreamAll versions0:3.2.0-2.el9_2
go-filesystem Red Hat:rhel_eus:9.4::appstreamAll versions0:3.2.0-4.el9_4
go-rpm-macros Red Hat:rhel_eus:9.4::appstreamAll versions0:3.2.0-4.el9_4
go-rpm-templates Red Hat:rhel_eus:9.4::appstreamAll versions0:3.2.0-4.el9_4
go-srpm-macros Red Hat:rhel_eus:9.4::appstreamAll versions0:3.2.0-4.el9_4
go-filesystem Red Hat:rhel_eus:9.6::appstreamAll versions0:3.6.0-11.el9_6
go-rpm-macros Red Hat:rhel_eus:9.6::appstreamAll versions0:3.6.0-11.el9_6
go-rpm-macros-debuginfo Red Hat:rhel_eus:9.6::appstreamAll versions0:3.6.0-11.el9_6
go-rpm-macros-debugsource Red Hat:rhel_eus:9.6::appstreamAll versions0:3.6.0-11.el9_6
go-rpm-templates Red Hat:rhel_eus:9.6::appstreamAll versions0:3.6.0-11.el9_6
go-srpm-macros Red Hat:rhel_eus:9.6::appstreamAll versions0:3.6.0-11.el9_6
go-rpm-macros Rocky Linux:9All versions0:3.6.0-12.el9_7

Products include Golang Go.

How do I fix CVE-2025-47906?

Upgrade golang to a fixed version for your release line: 1.23.12 or 1.24.6.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-47906 being exploited?

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

All Golang Go vulnerabilities

Sources

Also known as ALSA-2025:22005, AZL-66128, AZL-66131, AZL-67512, BELL-CVE-2025-47906, BIT-golang-2025-47906 and 147 more.

Is CVE-2025-47906 in your software?

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

Check your SBOMs for free