CVE-2025-6224: Key leakage in juju/utils certificates

Published Jul 1, 2025
·
Updated

Summary

Certs generated by v4 contain their private key.

Details

Background

Recently, I encountered an API in Go that’s easy to misuse: sha512.Sum384 and sha512.New384().Sum look very similar and behave very differently. https://go.dev/play/p/kDCqqoYk84k demonstrates this. I want to discuss extending static analysis to detect this case with the go community, but before I do that, I want to make a best-effort pass at open-source projects to fix the existing bugs. I figured that if there were any vulnerabilities out there, they would be easy to find once that discussion begins, so it’s better to address them early.

This work is a hobby project and has no affiliation with my employer, so I may be slow to respond due to existing commitments.

PoC

https://go.dev/play/p/vSW0U3Hq4qk

Impact

This code (cert.NewLeaf) generates certs with the SubjectKeyId set to sha512.New384().Sum(/ private / key).

If a cert which was generated by cert.NewLeaf is transferred over the network in plaintext, as is often the case in TLS handshakes, an attacker listening on that network may sniff the cert and trivially extract the private key from it. This applies to client and server TLS certs generated by vulnerable versions of this library.

Getting the server cert and its key would only require performing a TLS handshake (with a matching SNI) with the server. At that point, the attacker could impersonate the server.

Similarly, getting the client cert and its key would require getting the client to perform a TLS handshake against an attacker-controlled server. At that point, an attacker could impersonate the client.

Other sources

Certificate generation in juju/utils using the cert.NewLeaf function could include private information. If this certificate were then transferred over the network in plaintext, an attacker listening on that network could sniff the certificate and trivially extract the private key from it.

MITRE

Affected Software

3 affected componentsFixes available
Canonical Juju
go/github.com/juju/utils/v4/cert<=4.0.3
4.0.4
Canonical Juju\/utils Go>=4.0.0<4.0.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/juju/utils/v4/cert to a version that resolves this vulnerability.

    Fixed in 4.0.4

Event History

Jul 1, 2025
CVE Published
via MITRE·10:39 AM
Data Sourced
via MITRE·10:39 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 AM
Affected Software
Advisory Published
via GitHub·05:35 PM
Data Sourced
via GitHub·05:35 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-6224?

CVE-2025-6224 is classified as a high severity vulnerability due to the risk of private key exposure.

2

How do I fix CVE-2025-6224?

To fix CVE-2025-6224, it is recommended to upgrade to the latest version of Canonical Juju that addresses this vulnerability.

3

Who is affected by CVE-2025-6224?

CVE-2025-6224 affects users of Canonical Juju who utilize the cert.NewLeaf function for certificate generation.

4

What is the impact of CVE-2025-6224?

The impact of CVE-2025-6224 includes the potential for attackers to intercept and extract private keys from plaintext certificates transmitted over the network.

5

Is CVE-2025-6224 easily exploitable?

Yes, CVE-2025-6224 is easily exploitable as an attacker can sniff network traffic to obtain sensitive private key information.

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