CVE-2022-30633: Stack exhaustion when unmarshaling certain documents in encoding/xml
Summary
CVE-2022-30633: Stack exhaustion when unmarshaling certain documents in encoding/xml. Affects stdlib across 2 version ranges.
< 1.17.12
>= 1.18.0-0, < 1.18.4
Fixed in 1.17.12 or 1.18.4, depending on the release line you run. How to fix ↓
Also tracked for
- golang · Bitnami
- golang-1.15 · Debian:11
The same CVE-2022-30633 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 the Go standard library provides functionality for encoding and decoding XML data. It includes a decoder that can unmarshal XML documents into Go structs. This vulnerability affects versions 0 through 1.17.12 and 1.18.0-0 through 1.18.4 of the Go standard library.
Vulnerability Detail
When unmarshaling an XML document into a Go struct that has a nested field using the 'any' field tag, a stack exhaustion vulnerability can occur. This vulnerability can lead to a panic due to stack exhaustion. An attacker could potentially exploit this vulnerability by crafting a malicious XML document that triggers the panic, causing a denial-of-service condition or possibly executing arbitrary code.
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.17.121.17.12go get stdlib@v1.17.12 -
>= 1.18.0-0, < 1.18.41.18.4go get stdlib@v1.18.4
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is currently no known workaround for this vulnerability. It is recommended to update to the patched versions of the Go standard library as mentioned in the 'how_to_fix' section.
Conclusion
In conclusion, the 'encoding/xml' package in the Go standard library is vulnerable to a stack exhaustion issue when unmarshaling certain XML documents. This vulnerability can lead to a denial-of-service condition or potential code execution. It is crucial for developers to update their Go installations to the patched versions mentioned in the 'how_to_fix' section to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for stdlib →
FAQ
This vulnerability can lead to a denial-of-service condition or potentially allow an attacker to execute arbitrary code.
Versions 0 through 1.17.12 and 1.18.0-0 through 1.18.4 of the Go standard library are affected.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Gopkg.lock file and the Vulert Playground will analyze it for open-source vulnerabilities, including this one.
No, there is currently no known workaround for this vulnerability. It is recommended to update to the patched versions of the Go standard library.
You can find more information about this vulnerability in the Go vulnerability database at https://pkg.go.dev/vuln/GO-2022-0523.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.