CVE-2026-56859: Stack Exhaustion Vulnerability in Go's encoding/xml Package
Summary
CVE-2026-56859: Add recursion depth guard during decode in encoding/xml. Affects stdlib across 3 version ranges.
< 1.25.13
>= 1.26.0-0, < 1.26.6
>= 1.27.0-0, < 1.27.0-rc.3
Fixed in 1.25.13, 1.26.6 or 1.27.0-rc.3, depending on the release line you run. How to fix ↓
Also tracked for
- golang · Bitnami
The same CVE-2026-56859 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
The encoding/xml package in Go provides functionality for encoding and decoding XML data. It is widely used for parsing XML documents and converting them into Go data structures. This package is integral to applications that rely on XML for data interchange. However, it has a vulnerability that can lead to stack exhaustion due to improper handling of recursion depth during decoding operations.
Vulnerability Detail
The vulnerability arises from the DecodeElement function, which resets the depth counter without properly managing recursion limits. This oversight can lead to excessive recursion, ultimately resulting in stack exhaustion. If exploited, this vulnerability could cause applications to crash or become unresponsive, posing a significant risk to system stability and reliability.
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.25.131.25.13go get stdlib@v1.25.13 -
>= 1.26.0-0, < 1.26.61.26.6go get stdlib@v1.26.6 -
>= 1.27.0-0, < 1.27.0-rc.31.27.0-rc.3go get stdlib@v1.27.0-rc.3
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, developers can implement their own recursion depth checks in their XML decoding logic to prevent excessive recursion until they can update to a patched version.
Conclusion
The CVE-2026-56859 vulnerability in Go's encoding/xml package poses a significant risk due to potential stack exhaustion from improper recursion depth management. It is crucial for developers to update to the latest patched versions to mitigate this risk and ensure application stability.
See every vulnerability recorded for stdlib →
FAQ
CVE-2026-56859 is a vulnerability in the Go programming language's encoding/xml package that can lead to stack exhaustion due to improper recursion depth management.
Exploitation of this vulnerability can cause applications to crash or become unresponsive, leading to potential downtime and loss of service.
Affected versions include all versions prior to 1.25.13, 1.26.6, and 1.27.0-rc.3.
You can check if your application is affected by using Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to use the Vulert playground without signup.
If immediate updates are not possible, consider implementing custom recursion depth checks in your XML decoding logic as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.