Vulnerabilities in pkg:golang/github.com/juju/utils/v4/cert
PACKAGECVE-2025-6224 is a MODERATE (CVSS 6.5) juju/utils leaks private key vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting Github.com/juju/utils/v4/cert libraries in the Go ecosystem. The issue involves juju/utils leaks private key in certs. Remediation is available by upgrading affected packages to version 4.0.4.
pkg:golang/github.com/juju/utils/v4/cert
Vulnerability advisories affecting package pkg:golang/github.com/juju/utils/v4/cert. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-h34r-jxqm-qgpr | CVE-2025-6224 | MODERATE | juju/utils leaks private key in certs |
CVE-2025-6224 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2025-6224
To remediate this vulnerability, upgrade all affected Github.com/juju/utils/v4/cert dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/juju/utils/v4/cert to 4.0.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/juju/utils/v4/cert
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-6224, inspect your project dependencies for Github.com/juju/utils/v4/cert:
inspect dependencies for github.com/juju/utils/v4/cert
Analyze the terminal output to locate any version of Github.com/juju/utils/v4/cert in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. In Github.com/juju/utils/v4/cert, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-6224 Affected Github.com/juju/utils/v4/cert Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/juju/utils/v4/cert
|
Go |
< 4.0.4
|
4.0.4
|
References
Frequently Asked Questions
What is CVE-2025-6224?
Which Github.com/juju/utils/v4/cert versions are affected?
What version fixes CVE-2025-6224?
Is github.com/juju/utils/v4/cert affected?
What is the CVSS score of CVE-2025-6224?
What CWE is associated with CVE-2025-6224?
How can I check Go dependencies for CVE-2025-6224?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h34r-jxqm-qgpr",
"modified" : "2025-07-01T17:35:16Z",
"published" : "2025-07-01T17:35:16Z",
"aliases" : [ "CVE-2025-6224" ],
"summary" : "juju/utils leaks private key in certs",
"details" : "### Summary\n\nCerts generated by v4 contain their private key.\n\n## Details\n\n### Background\n\nRecently, 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. \n\nThis work is a hobby project and has no affiliation with my employer, so I may be slow to respond due to existing commitments. \n\n### PoC\n\nhttps://go.dev/play/p/vSW0U3Hq4qk\n\n### Impact\n\n[This code](https://github.com/juju/utils/blob/0141ef0ee74a0cac603c5c9e4aff194008722f41/cert/cert.go#L120) (cert.NewLeaf) generates certs with the SubjectKeyId set to `sha512.New384().Sum(/* private */ key)`.\n\nIf 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.\n\nGetting 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.\n\nSimilarly, 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/juju/utils/v4/cert"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.0.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.0.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/juju/utils/security/advisories/GHSA-h34r-jxqm-qgpr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-6224"
}, {
"type" : "WEB",
"url" : "https://github.com/juju/utils/commit/766f27d7bcd10433453a9764509a864c17a46a76"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/juju/utils"
}, {
"type" : "WEB",
"url" : "https://github.com/juju/utils/releases/tag/v4.0.4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-312" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-07-01T17:35:16Z",
"nvd_published_at" : "2025-07-01T11:15:21Z"
}
}