CVE-2025-47906: Golang LookPath Vulnerability Leading to Unexpected Executable Returns

golang Updated 02 Oct 2025

Summary

20/09/2025
Yes i
Medium
Not published

CVE-2025-47906: Unexpected paths returned from LookPath in os/exec. Affects golang across 2 version ranges.

< 1.23.12 >= 1.24.0, < 1.24.6

Fixed in 1.23.12 or 1.24.6, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-47906 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Golang, developed by Google, is an open-source programming language designed for simplicity and efficiency in building scalable and high-performance applications. It features garbage collection, strong typing, and built-in support for concurrent programming. However, it is susceptible to vulnerabilities that can affect its execution environment, such as the LookPath function, which is used to find executables in the system's PATH.

Vulnerability Detail

The vulnerability arises when the PATH environment variable contains executable paths instead of just directories. When certain strings (namely "", ".", and "..") are passed to the LookPath function, it may return binaries listed in the PATH unexpectedly. This can lead to security risks, as malicious executables could be executed unintentionally, compromising the integrity of the application and potentially leading to unauthorized access or data breaches.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.23.12 1.23.12
  • >= 1.24.0, < 1.24.6 1.24.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid including executable paths in the PATH environment variable. Instead, ensure that only directory paths are present, which can help mitigate the risk of unexpected binaries being returned by LookPath.

Conclusion

The CVE-2025-47906 vulnerability in Golang's LookPath function poses a significant risk by allowing unexpected executables to be returned. It is crucial to update to the patched versions to mitigate this risk and ensure the security of your applications.

See every vulnerability recorded for golang →

Share this vulnerability

FAQ

CVE-2025-47906 is a vulnerability in Golang's LookPath function that can return unexpected executables if the PATH variable contains executable paths.

This vulnerability can lead to the execution of unintended binaries, potentially compromising the security and integrity of your application.

Affected versions include all versions prior to 1.23.12 and 1.24.0 up to 1.24.6.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.

If an immediate update is not possible, consider removing executable paths from your PATH variable as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for golang.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.23.12 1.23.12
  • >= 1.24.0, < 1.24.6 1.24.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback