CVE-2023-29403: Unsafe behavior in setuid/setgid binaries in Go runtime

stdlib Updated 02 Oct 2025

Summary

08/06/2023
Yes i
Unrated
Not published

CVE-2023-29403: Unsafe behavior in setuid/setgid binaries in runtime. Affects stdlib across 2 version ranges.

< 1.19.10 >= 1.20.0-0, < 1.20.5

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

Also tracked for

The same CVE-2023-29403 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Go standard library (stdlib) is a collection of packages that provide essential functionality for Go programs. It includes various modules for tasks such as file I/O, networking, and concurrency. The Go runtime is responsible for managing the execution of Go programs, including memory management and scheduling.

In Unix platforms, setuid/setgid binaries are programs that run with the privileges of the user or group that owns them, rather than the privileges of the user executing them. This allows certain operations to be performed with elevated privileges.

However, the Go runtime does not differentiate the behavior of binaries when run with setuid/setgid bits. This can lead to unsafe behavior in certain scenarios, such as when accessing memory or assuming the status of standard I/O file descriptors.

Vulnerability Detail

The vulnerability in the Go runtime affects setuid/setgid binaries. When such a binary is executed with closed standard I/O file descriptors, opening any files can result in unexpected content being read or written with elevated privileges. Additionally, if a setuid/setgid program is terminated, either due to a panic or a signal, it may leak the contents of its registers. These issues can potentially lead to unauthorized access, data leakage, or privilege escalation.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 1.19.10 1.19.10
    go get stdlib@v1.19.10
  • >= 1.20.0-0, < 1.20.5 1.20.5
    go get stdlib@v1.20.5

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 workaround, it is advised to avoid running setuid/setgid binaries with closed standard I/O file descriptors. Keeping the standard I/O file descriptors open can help mitigate the risk of unexpected content being read or written with elevated privileges. Additionally, it is recommended to handle panics and signals properly in setuid/setgid programs to prevent the leakage of register contents.

Conclusion

The vulnerability in the Go runtime's handling of setuid/setgid binaries can lead to unsafe behavior and potential security risks. It is crucial to update the Go runtime to the recommended versions to mitigate these issues. Additionally, following the provided workarounds can help reduce the risk of exploitation. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

A setuid/setgid binary is a program that runs with the privileges of the user or group that owns it, rather than the privileges of the user executing it. This allows certain operations to be performed with elevated privileges.

The risks of this vulnerability include unauthorized access, data leakage, and privilege escalation. If a setuid/setgid binary is executed with closed standard I/O file descriptors, it can read or write unexpected content with elevated privileges. Additionally, terminating a setuid/setgid program may leak the contents of its registers.

To fix this vulnerability, update the Go runtime to version 1.19.10 or later, or version 1.20.5 or later. These versions include the necessary changes to address the unsafe behavior in setuid/setgid binaries.

As a workaround, avoid running setuid/setgid binaries with closed standard I/O file descriptors. Keeping the standard I/O file descriptors open can help mitigate the risk of unexpected content being read or written with elevated privileges. Additionally, handle panics and signals properly in setuid/setgid programs to prevent the leakage of register contents.

For more information about this vulnerability, refer to the Go vulnerability database at https://pkg.go.dev/vuln/GO-2023-1840.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 1.19.10 1.19.10
    go get stdlib@v1.19.10
  • >= 1.20.0-0, < 1.20.5 1.20.5
    go get stdlib@v1.20.5

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