CVE-2026-56859: Stack Exhaustion Vulnerability in Go's encoding/xml Package

stdlib Updated 14 Aug 2026

Summary

13/08/2026
Yes i
Unrated
Not published

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

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.

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

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 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.13 1.25.13
    go get stdlib@v1.25.13
  • >= 1.26.0-0, < 1.26.6 1.26.6
    go get stdlib@v1.26.6
  • >= 1.27.0-0, < 1.27.0-rc.3 1.27.0-rc.3
    go 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 →

Share this vulnerability

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.

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.25.13 1.25.13
    go get stdlib@v1.25.13
  • >= 1.26.0-0, < 1.26.6 1.26.6
    go get stdlib@v1.26.6
  • >= 1.27.0-0, < 1.27.0-rc.3 1.27.0-rc.3
    go 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 →

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