encoding/xml: Uncontrolled Recursion
CVE-2022-30633 is a high-severity uncontrolled recursion vulnerability in encoding/xml from Go standard library, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 1.17.12, 1.18.4 as the first without the flaw, so updating encoding/xml to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 2.21% chance of exploitation within 30 days, higher than 83% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update encoding/xml to 1.17.12 or 1.18.4, whichever matches your release line, or a later version.
- Update Go to 1.17.12 or 1.18.4, whichever matches your release line, or a later version.
- Read the advisory on go.dev for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Go standard library | encoding/xml | before 1.17.12; 1.18.0-0 up to, but not including, 1.18.4 | 1.17.12, 1.18.4 |
| Go | Go | before 1.17.12; 1.18.0 up to, but not including, 1.18.4 | 1.17.12, 1.18.4 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- NoneNo data is disclosed.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.5 | High | NVD |
| CVSS 3.1 | 7.5 | High | CISA (ADP) |
Official description
Uncontrolled recursion in Unmarshal in encoding/xml before Go 1.17.12 and Go 1.18.4 allows an attacker to cause a panic due to stack exhaustion via unmarshalling an XML document into a Go struct which has a nested field that uses the 'any' field tag.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Uncontrolled Recursion
The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.
How developers prevent this class of flaw
- Ensure that an end condition will be reached under all logic conditions. The end condition may include checking against the depth of recursion and exiting with an error if the recursion goes too deep. The complexity of the end condition contributes to the effectiveness of this action.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
Other vulnerabilities in encoding/xml
- 7.5 High severity
Recent Uncontrolled Recursion vulnerabilities
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Spotted an error? Tell us.