// For flags

CVE-2022-41715

Memory exhaustion when compiling regular expressions in regexp/syntax

Severity Score

7.5
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

Programs which compile regular expressions from untrusted sources may be vulnerable to memory exhaustion or denial of service. The parsed regexp representation is linear in the size of the input, but in some cases the constant factor can be as high as 40,000, making relatively small regexps consume much larger amounts of memory. After fix, each regexp being parsed is limited to a 256 MB memory footprint. Regular expressions whose representation would use more space than that are rejected. Normal use of regular expressions is unaffected.

Los programas que compilan expresiones regulares desde fuentes no confiables pueden ser vulnerables al agotamiento de la memoria o a la denegación de servicio. La representación de la regexp analizada es lineal en el tamaño de la entrada, pero en algunos casos el factor constante puede llegar a ser de 40.000, lo que hace que regexps relativamente pequeñas consuman cantidades mucho mayores de memoria. Después de la corrección, cada regexp que es analizado está limitada a un espacio de memoria de 256 MB. Las expresiones regulares cuya representación use más espacio que eso son rechazadas. El uso normal de las expresiones regulares no está afectado

A flaw was found in the golang package, where programs that compile regular expressions from untrusted sources are vulnerable to memory exhaustion or a denial of service. The parsed regexp representation is linear in the input size. Still, in some cases, the constant factor can be as high as 40,000, making a relatively small regexp consume larger amounts of memory. After the fix, each regexp being parsed is limited to a 256 MB memory footprint. Regular expressions whose representation would use more space than that are rejected. Routine use of regular expressions is unaffected.

*Credits: Adam Korczynski (ADA Logics), OSS-Fuzz
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2022-09-28 CVE Reserved
  • 2022-10-14 CVE Published
  • 2024-06-04 EPSS Updated
  • 2024-08-03 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Golang
Search vendor "Golang"
Go
Search vendor "Golang" for product "Go"
< 1.18.7
Search vendor "Golang" for product "Go" and version " < 1.18.7"
-
Affected
Golang
Search vendor "Golang"
Go
Search vendor "Golang" for product "Go"
>= 1.19.0 < 1.19.2
Search vendor "Golang" for product "Go" and version " >= 1.19.0 < 1.19.2"
-
Affected