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

Published Feb 6, 2024
·
Updated

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.

Other sources

A memory leak flaw was found in the RSA encrypting/decrypting code which might lead to a resource exhaustion vulnerability, as it is theoretically exploitable 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. Unfortunately, notice that all the return statements related to error cases follow the "return nil, nil, fail(...)" pattern, which means that pkey​ and ctx​ will be nil inside the deferred function that should free them.

— Red Hat

Using crafted public RSA keys which are not compliant with SP 800-56B can cause a small memory leak when encrypting and verifying payloads.

An attacker can leverage this flaw to gradually erode available memory to the point where the host crashes for lack of resources. Upon restart the attacker would have to begin again, but nevertheless there is the potential to deny service.

— GitHub

Affected Software

6 affected componentsFixes available
go/github.com/microsoft/go-crypto-openssl/openssl<=0.2.8
0.2.9
go/github.com/golang-fips/openssl/v2<=2.0.0
2.0.1
go/github.com/microsoft/go-crypto-openssl<=0.2.8
go/github.com/golang-fips/go<=1.22.1
redhat/github.com/golang-fips/openssl/v2<2.0.1
2.0.1
redhat/github.com/microsoft/go-crypto-openssl/openssl<0.2.9
0.2.9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/microsoft/go-crypto-openssl/openssl to a version that resolves this vulnerability.

    Fixed in 0.2.9
  2. Upgrade

    Upgrade go/github.com/golang-fips/openssl/v2 to a version that resolves this vulnerability.

    Fixed in 2.0.1
  3. Upgrade

    Upgrade redhat/github.com/golang-fips/openssl/v2 to a version that resolves this vulnerability.

    Fixed in 2.0.1
  4. Upgrade

    Upgrade redhat/github.com/microsoft/go-crypto-openssl/openssl to a version that resolves this vulnerability.

    Fixed in 0.2.9

Event History

Feb 6, 2024
Data Sourced
via Red Hat·06:06 AM
DescriptionSeverityAffected Software
Mar 20, 2024
Advisory Published
via GitHub·06:10 PM
Mar 21, 2024
CVE Published
via MITRE·12:16 PM
Data Sourced
via MITRE·12:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:00 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2024-1394?

CVE-2024-1394 has a medium severity rating due to the potential for resource exhaustion from a memory leak.

2

How do I fix CVE-2024-1394?

To fix CVE-2024-1394, upgrade to version 2.0.1 of github.com/golang-fips/openssl/v2 or version 0.2.9 of github.com/microsoft/go-crypto-openssl.

3

What causes the memory leak in CVE-2024-1394?

The memory leak in CVE-2024-1394 is caused by flawed RSA encrypting/decrypting code in the Golang libraries.

4

Which versions are affected by CVE-2024-1394?

CVE-2024-1394 affects versions up to 2.0.0 of github.com/golang-fips/openssl/v2 and 0.2.8 of github.com/microsoft/go-crypto-openssl.

5

Is CVE-2024-1394 being actively exploited?

As of now, there are no widespread reports indicating active exploitation of CVE-2024-1394.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203