CVE-2022-24921: Input Validation
A stack overflow flaw was found in Golang's regexp module, which can crash the runtime if the application using regexp accepts very long or arbitrarily long regexps from untrusted sources that have sufficient nesting depths. To exploit this vulnerability, an attacker would need to send large regexps with deep nesting to the application. Triggering this flaw leads to a crash of the runtime, which causes a denial of service.
Other sources
Golang Go is vulnerable to a denial of service, caused by improper input validation. By using a specially-crafted deeply nested expression, a remote attacker could exploit this vulnerability to cause a goroutine stack exhaustion, and results in a denial of service condition.
— IBM
regexp.Compile in Go before 1.16.15 and 1.17.x before 1.17.8 allows stack exhaustion via a deeply nested expression.
Affected Software
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2022-24921?
CVE-2022-24921 is a vulnerability found in Golang's regexp module that can cause a stack overflow leading to a runtime crash.
How does CVE-2022-24921 impact the affected software?
CVE-2022-24921 can crash the runtime if the application using regexp accepts very long or arbitrarily long regexps, potentially leading to denial of service.
Which versions of Golang are affected by CVE-2022-24921?
Golang versions before 1.16.15 and 1.17.x before 1.17.8 are affected by CVE-2022-24921.
What is the severity of CVE-2022-24921?
CVE-2022-24921 has a severity score of 7.5 (high).
How can I fix CVE-2022-24921?
To fix CVE-2022-24921, upgrade to Golang version 1.16.15 or 1.17.8, depending on the version you are using.