# 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.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Mar 2024
- **Updated:** 29 Oct 2026
- **Also known as:** ALSA-2024:1462, ALSA-2024:1472, ALSA-2024:1501, ALSA-2024:1502, ALSA-2024:1644, ALSA-2024:1646, ALSA-2024:2569, ALSA-2024:4371, ALSA-2024:4378, ALSA-2024:4379, ALSA-2024:4502, ALSA-2024:4761, ALSA-2024:4762, AZL-110327, AZL-110382, AZL-110516, AZL-110519, GHSA-78hx-gp6g-7mj6, GO-2024-2660, RHSA-2024:1462, RHSA-2024:1468, RHSA-2024:1472, RHSA-2024:1501, RHSA-2024:1502, RHSA-2024:1561, RHSA-2024:1566, RHSA-2024:1644, RHSA-2024:1646, RHSA-2024:1763, RHSA-2024:2569, RHSA-2024:4371, RHSA-2024:4378, RHSA-2024:4379, RHSA-2024:4502, RHSA-2024:4581, RHSA-2024:4672, RHSA-2024:4761, RHSA-2024:4762, RLSA-2024:1472, RLSA-2024:1502, RLSA-2024:1644, RLSA-2024:1646, RLSA-2024:2569, RLSA-2024:4502

## 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 (Missing Release of Memory after Effective Lifetime)

## 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 | Ecosystem | 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 |
| `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 |
| `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.

## Is CVE-2024-1394 being exploited?

There is no known exploitation of CVE-2024-1394 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-1394 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2024-1394 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/golang-fips/openssl/v2 (Go): affected all versions; fixed in 2.0.1
- github.com/golang-fips/openssl/v2 (Go): affected all versions; fixed in 2.0.1
- github.com/golang-fips/openssl/v2 (Go): affected all versions; fixed in 2.0.1
- github.com/golang-fips/go (Go): affected all versions up to 1.22.1; no fix listed
- github.com/golang-fips/go (Go): affected all versions up to 1.22.1; no fix listed
- github.com/microsoft/go-crypto-openssl (Go): affected all versions up to 0.2.8; no fix listed
- github.com/microsoft/go-crypto-openssl (Go): affected all versions up to 0.2.8; no fix listed
- github.com/microsoft/go-crypto-openssl (Go): affected all versions; fixed in 0.2.9
- github.com/microsoft/go-crypto-openssl/openssl (Go): affected all versions; fixed in 0.2.9
- github.com/microsoft/go-crypto-openssl/openssl (Go): affected all versions; fixed in 0.2.9

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-1394/ (Markdown: https://insights.sbomify.com/CVE-2024-1394/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-1394
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-1394
- OSV: https://osv.dev/vulnerability/CVE-2024-1394

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-1394/
Summaries are generated and may contain mistakes; the official description above is the record.
