ADVISORIES

Go Vulnerability Database

GO-2021-0347

Stack exhaustion when compiling deeply nested expressions in regexp

Details

On 64-bit platforms, an extremely deeply nested expression can cause regexp.Compile to cause goroutine stack exhaustion, forcing the program to exit. Note this applies to very large expressions, on the order of 2MB.

Affected packages

EcosystemPackageAffected versions
Gostdlib
All versions before 1.16.15 (fixed in 1.16.15)
From 1.17.0-0 before 1.17.8 (fixed in 1.17.8)

References