CVE-2025-47906 Unexpected paths returned from LookPath in os/exec
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.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.23.12, 1.24.6 |
stdlib Go | All versions | 1.23.12, 1.24.6 |
Linux distribution packages (29)
go-filesystem AlmaLinux:9 | All versions | 3.6.0-12.el9_7 |
go-rpm-macros AlmaLinux:9 | All versions | 3.6.0-12.el9_7 |
go-rpm-templates AlmaLinux:9 | All versions | 3.6.0-12.el9_7 |
go-srpm-macros AlmaLinux:9 | All versions | 3.6.0-12.el9_7 |
go-filesystem Red Hat:enterprise_linux:9::appstream | All versions | 0:3.6.0-12.el9_7 |
go-rpm-macros Red Hat:enterprise_linux:9::appstream | All versions | 0:3.6.0-12.el9_7 |
go-rpm-macros-debuginfo Red Hat:enterprise_linux:9::appstream | All versions | 0:3.6.0-12.el9_7 |
go-rpm-macros-debugsource Red Hat:enterprise_linux:9::appstream | All versions | 0:3.6.0-12.el9_7 |
go-rpm-templates Red Hat:enterprise_linux:9::appstream | All versions | 0:3.6.0-12.el9_7 |
go-srpm-macros Red Hat:enterprise_linux:9::appstream | All versions | 0:3.6.0-12.el9_7 |
go-filesystem Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.0.9-12.el9_0 |
go-rpm-macros Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.0.9-12.el9_0 |
go-rpm-templates Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.0.9-12.el9_0 |
go-srpm-macros Red Hat:rhel_e4s:9.0::appstream | All versions | 0:3.0.9-12.el9_0 |
go-filesystem Red Hat:rhel_e4s:9.2::appstream | All versions | 0:3.2.0-2.el9_2 |
go-rpm-macros Red Hat:rhel_e4s:9.2::appstream | All versions | 0:3.2.0-2.el9_2 |
go-rpm-templates Red Hat:rhel_e4s:9.2::appstream | All versions | 0:3.2.0-2.el9_2 |
go-srpm-macros Red Hat:rhel_e4s:9.2::appstream | All versions | 0:3.2.0-2.el9_2 |
go-filesystem Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.2.0-4.el9_4 |
go-rpm-macros Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.2.0-4.el9_4 |
go-rpm-templates Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.2.0-4.el9_4 |
go-srpm-macros Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.2.0-4.el9_4 |
go-filesystem Red Hat:rhel_eus:9.6::appstream | All versions | 0:3.6.0-11.el9_6 |
go-rpm-macros Red Hat:rhel_eus:9.6::appstream | All versions | 0:3.6.0-11.el9_6 |
go-rpm-macros-debuginfo Red Hat:rhel_eus:9.6::appstream | All versions | 0:3.6.0-11.el9_6 |
go-rpm-macros-debugsource Red Hat:rhel_eus:9.6::appstream | All versions | 0:3.6.0-11.el9_6 |
go-rpm-templates Red Hat:rhel_eus:9.6::appstream | All versions | 0:3.6.0-11.el9_6 |
go-srpm-macros Red Hat:rhel_eus:9.6::appstream | All versions | 0:3.6.0-11.el9_6 |
go-rpm-macros Rocky Linux:9 | All versions | 0: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.
Other vulnerabilities in Golang Go
- CVE-2020-0601 Microsoft Windows CryptoAPI Spoofing
- CVE-2026-27143 Missing bound checks can lead to memory corruption in safe Go in cmd/compile
- CVE-2024-24790 Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip
- CVE-2023-39320 Arbitrary code execution via go.mod toolchain directive in cmd/go
- CVE-2023-24540 Improper handling of JavaScript whitespace in html/template
Sources
Also known as ALSA-2025:22005, AZL-66128, AZL-66131, AZL-67512, BELL-CVE-2025-47906, BIT-golang-2025-47906 and 147 more.