CVE-2022-41715: Memory exhaustion when compiling regular expressions in regexp/syntax
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.
Other sources
Golang Go is vulnerable to a denial of service, caused by the compilation of regular expressions from untrusted sources. A remote attacker could exploit this vulnerability to exhaust all available memory resources.
— IBM
Memory exhaustion when compiling regular expressions in regexp/syntax
— Microsoft
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.
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.
Each regexp being parsed is now limited to a 256 MB memory footprint. Regular expressions whose representation would use more space than that are now rejected. Normal use of regular expressions is unaffected.
ref: https://groups.google.com/g/golang-announce/c/xtuG5faxtaU?pli=1
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/openshift-serverless-clientsto a version that resolves this vulnerability.Fixed in 0:1.6.1-1.el8 - Upgrade
Upgrade
redhat/go-toolsetto a version that resolves this vulnerability.Fixed in 1.18-0:1.18.9-1.el7_9 - Upgrade
Upgrade
redhat/go-toolsetto a version that resolves this vulnerability.Fixed in 1.18-golang-0:1.18.9-1.el7_9 - Upgrade
Upgrade
redhat/osbuild-composerto a version that resolves this vulnerability.Fixed in 0:75-1.el8 - Upgrade
Upgrade
redhat/weldr-clientto a version that resolves this vulnerability.Fixed in 0:35.9-2.el8 - Upgrade
Upgrade
redhat/grafanato a version that resolves this vulnerability.Fixed in 0:7.5.15-4.el8 - Upgrade
Upgrade
redhat/git-lfsto a version that resolves this vulnerability.Fixed in 0:3.2.0-2.el8 - Upgrade
Upgrade
redhat/golangto a version that resolves this vulnerability.Fixed in 0:1.18.9-1.el9_1 - Upgrade
Upgrade
redhat/grafanato a version that resolves this vulnerability.Fixed in 0:9.0.9-2.el9 - Upgrade
Upgrade
redhat/osbuild-composerto a version that resolves this vulnerability.Fixed in 0:76-2.el9_2 - Upgrade
Upgrade
redhat/weldr-clientto a version that resolves this vulnerability.Fixed in 0:35.9-1.el9 - Upgrade
Upgrade
redhat/git-lfsto a version that resolves this vulnerability.Fixed in 0:3.2.0-1.el9 - Upgrade
Upgrade
redhat/golang-github-cpuguy83-md2manto a version that resolves this vulnerability.Fixed in 0:2.0.2-4.el9 - Upgrade
Upgrade
redhat/butaneto a version that resolves this vulnerability.Fixed in 0:0.16.0-2.rhaos4.12.el8 - Upgrade
Upgrade
redhat/ignitionto a version that resolves this vulnerability.Fixed in 0:2.14.0-5.rhaos4.12.el8 - Upgrade
Upgrade
redhat/openshift-clientsto a version that resolves this vulnerability.Fixed in 0:4.12.0-202301042257.p0.g854f807.assembly.stream.el9 - Upgrade
Upgrade
redhat/buildahto a version that resolves this vulnerability.Fixed in 1:1.23.4-4.rhaos4.12.el9 - Upgrade
Upgrade
redhat/conmonto a version that resolves this vulnerability.Fixed in 2:2.1.2-4.rhaos4.12.el8 - Upgrade
Upgrade
redhat/podmanto a version that resolves this vulnerability.Fixed in 3:4.2.0-7.rhaos4.12.el9 - Upgrade
Upgrade
redhat/runcto a version that resolves this vulnerability.Fixed in 3:1.1.6-4.rhaos4.12.el8 - Upgrade
Upgrade
redhat/skopeoto a version that resolves this vulnerability.Fixed in 2:1.9.4-3.rhaos4.12.el9 - Upgrade
Upgrade
redhat/etcdto a version that resolves this vulnerability.Fixed in 0:3.3.23-12.el8 - Upgrade
Upgrade
redhat/skupper-clito a version that resolves this vulnerability.Fixed in 0:1.4.1-2.el8 - Upgrade
Upgrade
redhat/skupper-routerto a version that resolves this vulnerability.Fixed in 0:2.4.1-2.el8 - Upgrade
Upgrade
redhat/skupper-clito a version that resolves this vulnerability.Fixed in 0:1.4.1-2.el9 - Upgrade
Upgrade
redhat/skupper-routerto a version that resolves this vulnerability.Fixed in 0:2.4.1-2.el9 - Upgrade
Upgrade
debian/golang-1.19to a version that resolves this vulnerability.Fixed in 1.19.8-2 - Upgrade
Upgrade
redhat/goto a version that resolves this vulnerability.Fixed in 1.19.2 - Upgrade
Upgrade
redhat/goto a version that resolves this vulnerability.Fixed in 1.18.7
Event History
Parent advisories
This vulnerability appears in the following advisories.
- RHSA-2023:1174
- RHSA-2023:1042
- RHSA-2023:3664
- RHSA-2023:0708
- RHSA-2023:0584
- RHSA-2023:0631
- RHSA-2023:3642
- RHSA-2023:0445
- RHSA-2023:0446
- RHSA-2023:2780
- RHSA-2023:2784
- RHSA-2023:2866
- RHSA-2023:0328
- RHSA-2023:2167
- RHSA-2023:2204
- RHSA-2023:2357
- RHSA-2023:2592
- RHSA-2023:0693
- RHSA-2022:8535
- RHSA-2022:7398
- RHSA-2022:7399
- RHSA-2023:0727
- RHSA-2023:3613
- RHSA-2023:0542
- RHSA-2023:1275
- RHSA-2023:1079
- RHSA-2023:3205
- RHSA-2023:3742
- RHSA-2022:8781
- RHSA-2023:0264
- RHSA-2023:0709
- RHSA-2023:4003
- RHSA-2023:1529
- IBM-7183851
Frequently Asked Questions
What is the vulnerability ID?
The vulnerability ID is CVE-2022-41715.
What is the severity of CVE-2022-41715?
The severity of CVE-2022-41715 is high.
Which software packages are affected by CVE-2022-41715?
The affected software packages are go, openshift-serverless-clients, go-toolset, osbuild-composer, weldr-client, grafana, git-lfs, golang, golang-github-cpuguy83-md2man, butane, ignition, openshift-clients, buildah, conmon, podman, runc, skopeo, etcd, skupper-cli, and skupper-router.
How can I fix CVE-2022-41715?
To fix CVE-2022-41715, update the affected software packages to the specified versions.
Where can I find more information about CVE-2022-41715?
You can find more information about CVE-2022-41715 at the following references: [link1], [link2], [link3].