CVE-2024-1394 Golang-fips/openssl: memory leaks in code encrypting and decrypting rsa payloads
A memory leak in the Go FIPS OpenSSL library allows attackers to cause resource exhaustion and denial of service via crafted RSA payloads.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-1394?
CVE-2024-1394 is a high-severity denial of service vulnerability in Red Hat NBDE Tang Server, published on 21 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
A memory leak flaw was found in Golang in the RSA encrypting/decrypting code, which might lead to a resource exhaustion vulnerability using attacker-controlled inputs. The memory leak happens in github.com/golang-fips/openssl/openssl/rsa.go#L113. The objects leaked are pkey and ctx. That function uses named return parameters to free pkey and ctx if there is an error initializing the context or setting the different properties. All return statements related to error cases follow the "return nil, nil, fail(...)" pattern, meaning that pkey and ctx will be nil inside the deferred function that should free them.
Weakness: CWE-401
Which versions are affected by CVE-2024-1394?
10 open source packages ship an affected version, including github.com/golang-fips/openssl/v2, github.com/golang-fips/go and github.com/microsoft/go-crypto-openssl.
| Package | Affected | Fixed in |
|---|---|---|
github.com/golang-fips/openssl/v2 Go | All versions | 2.0.1 |
github.com/golang-fips/openssl/v2 Go | All versions | 2.0.1 |
github.com/golang-fips/openssl/v2 Go | All versions | 2.0.1 |
github.com/golang-fips/go Go | All versions to 1.22.1 | None |
github.com/golang-fips/go Go | All versions to 1.22.1 | None |
github.com/microsoft/go-crypto-openssl Go | All versions to 0.2.8 | None |
4 more packages
github.com/microsoft/go-crypto-openssl Go | All versions to 0.2.8 | None |
github.com/microsoft/go-crypto-openssl Go | All versions | 0.2.9 |
github.com/microsoft/go-crypto-openssl/openssl Go | All versions | 0.2.9 |
github.com/microsoft/go-crypto-openssl/openssl Go | All versions | 0.2.9 |
Linux distribution packages (30)
delve AlmaLinux:8 | All versions | 1.20.2-1.module_el8.9.0+3642+43318da8 |
go-toolset AlmaLinux:8 | All versions | 1.20.12-1.module_el8.9.0+3728+f1d47c6f |
golang AlmaLinux:8 | All versions | 1.20.12-3.module_el8.9.0+3750+10f4110d |
golang-bin AlmaLinux:8 | All versions | 1.20.12-3.module_el8.9.0+3750+10f4110d |
golang-docs AlmaLinux:8 | All versions | 1.20.12-3.module_el8.9.0+3750+10f4110d |
golang-misc AlmaLinux:8 | All versions | 1.20.12-3.module_el8.9.0+3750+10f4110d |
golang-src AlmaLinux:8 | All versions | 1.20.12-3.module_el8.9.0+3750+10f4110d |
golang-tests AlmaLinux:8 | All versions | 1.20.12-3.module_el8.9.0+3750+10f4110d |
grafana AlmaLinux:8 | All versions | 9.2.10-8.el8_9.alma.1 |
grafana-pcp AlmaLinux:8 | All versions | 5.1.1-2.el8_9.alma.1 |
buildah AlmaLinux:9 | All versions | 2:1.33.7-3.el9_4 |
buildah-tests AlmaLinux:9 | All versions | 2:1.33.7-3.el9_4 |
containernetworking-plugins AlmaLinux:9 | All versions | 1:1.4.0-4.el9_4 |
go-toolset AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
golang AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
golang-bin AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
golang-docs AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
golang-misc AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
golang-src AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
golang-tests AlmaLinux:9 | All versions | 1.20.12-2.el9_3 |
grafana AlmaLinux:9 | All versions | 9.2.10-8.el9_3.alma.1 |
grafana-pcp AlmaLinux:9 | All versions | 5.1.1-2.el9_3.alma.1 |
grafana-pcp AlmaLinux:9 | All versions | 5.1.1-2.el9_4.alma.1 |
gvisor-tap-vsock AlmaLinux:9 | All versions | 6:0.7.3-4.el9_4.alma.1 |
podman AlmaLinux:9 | All versions | 4:4.9.4-5.el9_4 |
podman-docker AlmaLinux:9 | All versions | 4:4.9.4-5.el9_4 |
podman-plugins AlmaLinux:9 | All versions | 4:4.9.4-5.el9_4 |
podman-remote AlmaLinux:9 | All versions | 4:4.9.4-5.el9_4 |
podman-tests AlmaLinux:9 | All versions | 4:4.9.4-5.el9_4 |
runc AlmaLinux:9 | All versions | 4:1.1.12-3.el9_4 |
How do I fix CVE-2024-1394?
Upgrade github.com/golang-fips/openssl/v2 to 2.0.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2024-1394 being exploited?
There is no known exploitation of CVE-2024-1394 in the wild and no public exploit code.
Sources
Also known as ALSA-2024:1462, ALSA-2024:1472, ALSA-2024:1501, ALSA-2024:1502, ALSA-2024:1644, ALSA-2024:1646 and 38 more.