# 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.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Sep 2025
- **Updated:** 4 Nov 2025
- **Also known as:** ALSA-2025:22005, AZL-66128, AZL-66131, AZL-67512, BELL-CVE-2025-47906, BIT-golang-2025-47906, CLEANSTART-2026-MQ70542, CLEANSTART-2026-NW20382, CLEANSTART-2026-SZ05253, CLSA-2025-1765379145, CLSA-2025-1765824979, CLSA-2025-1766233299, DEBIAN-CVE-2025-47906, ECHO-720b-9e21-965c, GHSA-gwrf-jf3h-w649, GO-2025-3956, MINI-2j6j-m58j-6xv4, MINI-2p4g-cjpm-m5rw, MINI-2pxf-jxrc-26jq, MINI-335j-f49m-gr62, MINI-3384-72c7-r249, MINI-338r-4qrv-wgh3, MINI-349x-vc6m-fmfq, MINI-36cf-3w5x-5g3p, MINI-3g6f-44rv-x9hj, MINI-3j29-vhff-7fhw, MINI-42v8-r3x7-9q2h, MINI-44wv-v6h7-m3gh, MINI-4796-jv3v-w2cq, MINI-49hc-m6cm-m5vv, MINI-4c4f-pw4q-g46w, MINI-4cfw-pggq-p54h, MINI-4hgp-j37q-86v4, MINI-4mqg-458w-ccjp, MINI-4r4c-5f36-m6h6, MINI-536m-8mp7-3984, MINI-53pw-9m3q-rhg2, MINI-5622-95rh-5mmf, MINI-5884-2q6q-qq94, MINI-59p4-g9vw-f74v, MINI-5g33-9r7v-wfv2, MINI-5gr5-6vq3-mfgr, MINI-5hcg-jw9v-8mhx, MINI-5j73-pwqf-q3qm, MINI-5jf3-5f6f-vfgm, MINI-5m3h-cmg5-pwmw, MINI-63v6-f9fj-8jjw, MINI-662w-5v34-wj76, MINI-67qg-jwcj-8839, MINI-72pq-9qww-3hpm, MINI-7crv-4362-q62c, MINI-7m2m-76m5-9vxg, MINI-7mgm-m69q-hwjv, MINI-7qr3-3f2m-wvvr, MINI-7x8x-3j8r-6jc7, MINI-8272-87mm-w4rp, MINI-82h4-h6gp-393c, MINI-849c-ggv8-g965, MINI-87q7-8r9q-7cxw, MINI-89vh-hgpg-jf52, MINI-8pj8-6c3c-q5h6, MINI-8rgf-cjf6-9hr6, MINI-8x66-59hv-rwq6, MINI-8xfq-jqp9-xxpr, MINI-974m-2w3f-w883, MINI-9g3x-gv8m-c937, MINI-9gq3-8377-jcqh, MINI-9j35-chqx-5hxr, MINI-9jmp-hwvw-wr2m, MINI-9qvf-5j92-hvmw, MINI-9r3c-jv96-hrcm, MINI-9w83-4gv7-vchw, MINI-ccp7-wqgq-hgc6, MINI-cfxm-v35j-jjh4, MINI-cgj5-rm45-chjh, MINI-cq7p-7mj3-pwcq, MINI-cqpj-mrcr-w6qx, MINI-cqx2-675m-fc3j, MINI-f33h-2jgh-532p, MINI-f37r-ffmv-6275, MINI-fcq2-5wjc-28jr, MINI-g39x-369v-434f, MINI-g93v-6pqj-93h8, MINI-gf66-cjq3-fvj9, MINI-gmh9-pqxh-vphv, MINI-gpcf-4mx6-43r2, MINI-gw49-84qr-85r7, MINI-gw6f-v4vm-4m99, MINI-h2p3-98w7-fvcf, MINI-hvv5-g869-v7q7, MINI-j94p-w7wq-7f3f, MINI-j99w-vr94-2fx3, MINI-j9fm-c3gf-623q, MINI-jcxx-cj45-qq7r, MINI-jf4x-p432-hf8g, MINI-jpc9-hgp7-3j58, MINI-jqq5-fqrr-m8cm, MINI-jr3v-vw67-jv4m, MINI-m47q-4849-p46q, MINI-m757-6g8p-gxp2, MINI-mq65-3hvv-649w, MINI-mvr3-gmvf-mh9h, MINI-p54f-m387-mw9x, MINI-pjjg-m5xr-566x, MINI-pxwc-pxp8-jhc7, MINI-q2qh-785c-8w2c, MINI-q4v8-pvrh-625f, MINI-qp36-xfh8-vm25, MINI-qrrv-gxhh-w427, MINI-qwg7-9gxj-cwwj, MINI-qx5f-p9c3-m49f, MINI-qxp5-pc8j-7h27, MINI-r2pg-mpmc-63q3, MINI-r4fj-9gmh-mwr9, MINI-rhmx-9hc5-cg22, MINI-rr6f-2fxp-2gpv, MINI-rrr6-cw3m-4x4q, MINI-rvgm-34f9-wxv9, MINI-rxv6-p8vv-433f, MINI-v3rj-wx7w-g2v9, MINI-v489-6j69-98qv, MINI-v4rj-5mx8-hg3v, MINI-vm84-pw26-xvjq, MINI-vqfx-q85p-4cg3, MINI-vqrc-6x9g-w7f6, MINI-vwhg-2hvp-g2xf, MINI-w4m6-jp2r-8xj8, MINI-w5r6-82g8-cw75, MINI-w882-fp2p-5hrq, MINI-w9jh-q424-vcf7, MINI-wf47-2hhc-99x7, MINI-wqvx-xfhg-c5qx, MINI-wvfh-m5qg-hgjr, MINI-ww93-rhh5-r329, MINI-wx4q-5fqp-r9w3, MINI-x347-j2f7-4ppw, MINI-x35r-7528-7cpp, MINI-x49v-r427-jgpw, MINI-x96m-x3wx-rj39, MINI-x9rg-mv9p-qphq, MINI-xcp8-vf9m-9346, MINI-xmcg-ch36-6qgr, MINI-xrw8-8698-3cx9, MINI-xwrh-xx8g-xwrf, MINI-xxv4-rxfr-92fp, RHSA-2025:22004, RHSA-2025:22005, RHSA-2025:23833, RHSA-2025:23834, RHSA-2025:23851, RLSA-2025:22005, ROOT-OS-DEBIAN-13-CVE-2025-47906, UBUNTU-CVE-2025-47906

## 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 | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `golang` | Bitnami | All versions | 1.23.12, 1.24.6 |
| `stdlib` | Go | All versions | 1.23.12, 1.24.6 |
| `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: 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.

## 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](https://insights.sbomify.com/CVE-2020-0601/): Microsoft Windows CryptoAPI Spoofing (high 8.1, exploited in the wild)
- [CVE-2026-27143](https://insights.sbomify.com/CVE-2026-27143/): Missing bound checks can lead to memory corruption in safe Go in cmd/compile (critical 9.8)
- [CVE-2024-24790](https://insights.sbomify.com/CVE-2024-24790/): Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip (critical 9.8)
- [CVE-2023-39320](https://insights.sbomify.com/CVE-2023-39320/): Arbitrary code execution via go.mod toolchain directive in cmd/go (critical 9.8)
- [CVE-2023-24540](https://insights.sbomify.com/CVE-2023-24540/): Improper handling of JavaScript whitespace in html/template (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-47906 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2025-47906 in the wild and no public exploit code.

Affected packages and fixed versions:
- golang (Bitnami): affected all versions; fixed in 1.23.12, 1.24.6
- stdlib (Go): affected all versions; fixed in 1.23.12, 1.24.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-47906/ (Markdown: https://insights.sbomify.com/CVE-2025-47906/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-47906
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-47906
- OSV: https://osv.dev/vulnerability/CVE-2025-47906

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-47906/
Summaries are generated and may contain mistakes; the official description above is the record.
