CVE-2022-1962: Stack exhaustion due to deeply nested types in go/parser
A flaw was found in the golang standard library, go/parser. When calling any Parse functions on the Go source code, which contains deeply nested types or declarations, a panic can occur due to stack exhaustion. This issue allows an attacker to impact system availability.
Other sources
Calling any of the Parse functions on Go source code which contains deeply nested types or declarations can cause a panic due to stack exhaustion.
— Red Hat
Stack exhaustion due to deeply nested types in go/parser
— Microsoft
Uncontrolled recursion in the Parse functions in go/parser before Go 1.17.12 and Go 1.18.4 allow an attacker to cause a panic due to stack exhaustion via deeply nested types or declarations.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/skupper-clito a version that resolves this vulnerability.Fixed in 0:1.0.2-2.el8 - Upgrade
Upgrade
redhat/openshift-serverless-clientsto a version that resolves this vulnerability.Fixed in 0:1.3.1-4.el8 - Upgrade
Upgrade
redhat/go-toolsetto a version that resolves this vulnerability.Fixed in 1.17-golang-0:1.17.12-1.el7_9 - Upgrade
Upgrade
redhat/grafanato a version that resolves this vulnerability.Fixed in 0:7.5.15-3.el8 - Upgrade
Upgrade
redhat/golangto a version that resolves this vulnerability.Fixed in 0:1.17.12-1.el9_0 - Upgrade
Upgrade
redhat/grafanato a version that resolves this vulnerability.Fixed in 0:7.5.15-3.el9 - Upgrade
Upgrade
redhat/kubevirtto a version that resolves this vulnerability.Fixed in 0:4.12.0-1057.el7 - Upgrade
Upgrade
redhat/kubevirtto a version that resolves this vulnerability.Fixed in 0:4.12.0-1057.el8 - Upgrade
Upgrade
debian/golang-1.19to a version that resolves this vulnerability.Fixed in 1.19.8-2 - Upgrade
Upgrade
redhat/golangto a version that resolves this vulnerability.Fixed in 1.18.4 - Upgrade
Upgrade
redhat/golangto a version that resolves this vulnerability.Fixed in 1.17.12 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.18.5-1 - Upgrade
Upgrade
golang standard library (go/parser)to a version that resolves this vulnerability.Fixed in Go 1.17.12 - Upgrade
Upgrade
golang standard library (go/parser)to a version that resolves this vulnerability.Fixed in Go 1.18.4 - Compensating control
Avoid calling go/parser Parse functions on Go source code that contains deeply nested types or declarations, to prevent stack exhaustion leading to a panic.
Event History
Parent advisories
This vulnerability appears in the following advisories.
- RHSA-2022:6113
- RHSA-2022:6345
- RHSA-2022:6188
- RHSA-2022:6430
- RHSA-2023:1042
- RHSA-2022:6040
- RHSA-2022:6042
- RHSA-2022:6152
- RHSA-2022:6348
- RHSA-2022:6346
- RHSA-2022:6347
- RHSA-2022:6370
- RHSA-2022:5866
- RHSA-2022:5775
- RHSA-2022:7519
- RHSA-2022:7529
- RHSA-2023:2758
- RHSA-2023:2802
- RHSA-2022:5799
- RHSA-2022:8057
- RHSA-2022:9047
- RHSA-2022:6283
- RHSA-2023:0407
- RHSA-2023:0408
Frequently Asked Questions
What is CVE-2022-1962?
CVE-2022-1962 is a vulnerability in go/parser, a part of the golang standard library, that can lead to a system panic and impact system availability when parsing deeply nested types or declarations in Go source code.
What is the severity of CVE-2022-1962?
CVE-2022-1962 has a severity rating of medium with a CVSS score of 5.5.
How does CVE-2022-1962 affect the system?
CVE-2022-1962 can cause a panic and lead to system unavailability when calling Parse functions on Go source code that contains deeply nested types or declarations.
How can I fix CVE-2022-1962?
To fix CVE-2022-1962, update golang to version 1.18.4 or 1.17.12, depending on your current version.
Where can I find more information about CVE-2022-1962?
You can find more information about CVE-2022-1962 on the Red Hat Bugzilla page and the Red Hat Advisory page.