CVE-2025-25199: Github.com/microsoft/go crypto winnative Go-crypto-winnative BCryptGenerateSymmetricKey Memory Leak Vulnerability

HIGH
Advisory Identifier: GHSA-29c6-3hcj-89cf
CVSS 7.5
CWE-401
Published
Advisory Summary

CVE-2025-25199 is a HIGH (CVSS 7.5) go-crypto-winnative bcryptgeneratesymmetrickey memory leak vulnerability (CWE-401: Missing Release of Memory after Effective Lifetime) affecting Github.com/microsoft/go crypto winnative libraries in the Go ecosystem. The issue involves go-crypto-winnative bcryptgeneratesymmetrickey memory leak. Remediation is available by upgrading affected packages to version 0.0.0-20250211154640-f49c8e1379ea.

CVE-2025-25199 at a Glance

CVE Identifier CVE-2025-25199
GHSA Identifier GHSA-29c6-3hcj-89cf
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-401: Missing Release of Memory after Effective Lifetime
Affected Product Github.com/microsoft/go crypto winnative
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.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:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2025-25199

To remediate this vulnerability, upgrade all affected Github.com/microsoft/go crypto winnative dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/microsoft/go-crypto-winnative fixed: 0.0.0-20250211154640-f49c8e1379ea
Upgrade github.com/microsoft/go-crypto-winnative to 0.0.0-20250211154640-f49c8e1379ea
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/microsoft/go-crypto-winnative

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-25199, inspect your project dependencies for Github.com/microsoft/go crypto winnative:

inspect dependencies for github.com/microsoft/go-crypto-winnative

Analyze the terminal output to locate any version of Github.com/microsoft/go crypto winnative in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20250211154640-f49c8e1379ea), 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-401: Missing Release of Memory after Effective Lifetime, where the product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse. In Github.com/microsoft/go crypto winnative, 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

Calls to `cng.TLS1PRF` don't release the key handle, producing a small memory leak every time.

CVE-2025-25199 Affected Github.com/microsoft/go crypto winnative Versions

1 component(s)
Fixed Versions:
0.0.0-20250211154640-f49c8e1379ea
Product / Package Ecosystem Affected Versions Fixed Version
github.com/microsoft/go-crypto-winnative
Go
< 0.0.0-20250211154640-f49c8e1379ea
0.0.0-20250211154640-f49c8e1379ea

References

Frequently Asked Questions

What is CVE-2025-25199?
CVE-2025-25199 is a security vulnerability in Github.com/microsoft/go crypto winnative involving go-crypto-winnative BCryptGenerateSymmetricKey memory leak under CWE-401: Missing Release of Memory after Effective Lifetime.
Which Github.com/microsoft/go crypto winnative versions are affected?
Affected versions include releases prior to 0.0.0-20250211154640-f49c8e1379ea across affected packages: github.com/microsoft/go-crypto-winnative.
What version fixes CVE-2025-25199?
Upgrading to 0.0.0-20250211154640-f49c8e1379ea (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/microsoft/go-crypto-winnative affected?
Yes, github.com/microsoft/go-crypto-winnative is affected in releases prior to 0.0.0-20250211154640-f49c8e1379ea. Upgrade your dependency to 0.0.0-20250211154640-f49c8e1379ea or later.
What is the CVSS score of CVE-2025-25199?
CVE-2025-25199 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2025-25199?
CVE-2025-25199 is classified under CWE-401: Missing Release of Memory after Effective Lifetime (The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.).
How can I check Go dependencies for CVE-2025-25199?
Run the dependency tree command: 'inspect dependencies for github.com/microsoft/go-crypto-winnative'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-29c6-3hcj-89cf",
  "modified" : "2025-02-12T19:20:24Z",
  "published" : "2025-02-12T19:20:24Z",
  "aliases" : [ "CVE-2025-25199" ],
  "summary" : "go-crypto-winnative BCryptGenerateSymmetricKey memory leak",
  "details" : "Calls to `cng.TLS1PRF` don't release the key handle, producing a small memory leak every time.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/microsoft/go-crypto-winnative"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20250211154640-f49c8e1379ea"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/go-crypto-winnative/security/advisories/GHSA-29c6-3hcj-89cf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-25199"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/go-crypto-winnative/commit/f49c8e1379ea4b147d5bff1b3be5b0ff45792e41"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/microsoft/go-crypto-winnative"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-401" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-12T19:20:24Z",
    "nvd_published_at" : "2025-02-12T18:15:27Z"
  }
}