CVE-2024-1394 Golang-fips/openssl: memory leaks in code encrypting and decrypting rsa payloads

High 7.5 Published Updated

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.

PackageAffectedFixed in
github.com/golang-fips/openssl/v2 GoAll versions2.0.1
github.com/golang-fips/openssl/v2 GoAll versions2.0.1
github.com/golang-fips/openssl/v2 GoAll versions2.0.1
github.com/golang-fips/go GoAll versions to 1.22.1None
github.com/golang-fips/go GoAll versions to 1.22.1None
github.com/microsoft/go-crypto-openssl GoAll versions to 0.2.8None
4 more packages
github.com/microsoft/go-crypto-openssl GoAll versions to 0.2.8None
github.com/microsoft/go-crypto-openssl GoAll versions0.2.9
github.com/microsoft/go-crypto-openssl/openssl GoAll versions0.2.9
github.com/microsoft/go-crypto-openssl/openssl GoAll versions0.2.9
Linux distribution packages (30)
delve AlmaLinux:8All versions1.20.2-1.module_el8.9.0+3642+43318da8
go-toolset AlmaLinux:8All versions1.20.12-1.module_el8.9.0+3728+f1d47c6f
golang AlmaLinux:8All versions1.20.12-3.module_el8.9.0+3750+10f4110d
golang-bin AlmaLinux:8All versions1.20.12-3.module_el8.9.0+3750+10f4110d
golang-docs AlmaLinux:8All versions1.20.12-3.module_el8.9.0+3750+10f4110d
golang-misc AlmaLinux:8All versions1.20.12-3.module_el8.9.0+3750+10f4110d
golang-src AlmaLinux:8All versions1.20.12-3.module_el8.9.0+3750+10f4110d
golang-tests AlmaLinux:8All versions1.20.12-3.module_el8.9.0+3750+10f4110d
grafana AlmaLinux:8All versions9.2.10-8.el8_9.alma.1
grafana-pcp AlmaLinux:8All versions5.1.1-2.el8_9.alma.1
buildah AlmaLinux:9All versions2:1.33.7-3.el9_4
buildah-tests AlmaLinux:9All versions2:1.33.7-3.el9_4
containernetworking-plugins AlmaLinux:9All versions1:1.4.0-4.el9_4
go-toolset AlmaLinux:9All versions1.20.12-2.el9_3
golang AlmaLinux:9All versions1.20.12-2.el9_3
golang-bin AlmaLinux:9All versions1.20.12-2.el9_3
golang-docs AlmaLinux:9All versions1.20.12-2.el9_3
golang-misc AlmaLinux:9All versions1.20.12-2.el9_3
golang-src AlmaLinux:9All versions1.20.12-2.el9_3
golang-tests AlmaLinux:9All versions1.20.12-2.el9_3
grafana AlmaLinux:9All versions9.2.10-8.el9_3.alma.1
grafana-pcp AlmaLinux:9All versions5.1.1-2.el9_3.alma.1
grafana-pcp AlmaLinux:9All versions5.1.1-2.el9_4.alma.1
gvisor-tap-vsock AlmaLinux:9All versions6:0.7.3-4.el9_4.alma.1
podman AlmaLinux:9All versions4:4.9.4-5.el9_4
podman-docker AlmaLinux:9All versions4:4.9.4-5.el9_4
podman-plugins AlmaLinux:9All versions4:4.9.4-5.el9_4
podman-remote AlmaLinux:9All versions4:4.9.4-5.el9_4
podman-tests AlmaLinux:9All versions4:4.9.4-5.el9_4
runc AlmaLinux:9All versions4: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.

Is CVE-2024-1394 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free