CVE-2025-66220: Github.com/envoyproxy/envoy Envoy's TLS Certificate Matcher For Vulnerability

MODERATE
Advisory Identifier: GHSA-rwjg-c3h2-f57p
CVSS 5.0
CWE-170
Published
Advisory Summary

CVE-2025-66220 is a MODERATE (CVSS 5.0) envoy's tls certificate matcher for vulnerability (CWE-170: Improper Null Termination) affecting Github.com/envoyproxy/envoy libraries in the Go ecosystem. The issue involves envoy's tls certificate matcher for `match_typed_subject_alt_names` may incorrectly treat certificates containing an embedded null byte. Remediation is available by upgrading affected packages to version 1.36.3, 1.35.7, 1.34.11, 1.33.13.

CVE-2025-66220 at a Glance

CVE Identifier CVE-2025-66220
GHSA Identifier GHSA-rwjg-c3h2-f57p
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-170: Improper Null Termination
Affected Product Github.com/envoyproxy/envoy
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:L/A:N).

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

How to Fix CVE-2025-66220

To remediate this vulnerability, upgrade all affected Github.com/envoyproxy/envoy 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/envoyproxy/envoy fixed: 1.36.3
Upgrade github.com/envoyproxy/envoy to 1.36.3
github.com/envoyproxy/envoy fixed: 1.35.7
Upgrade github.com/envoyproxy/envoy to 1.35.7
github.com/envoyproxy/envoy fixed: 1.34.11
Upgrade github.com/envoyproxy/envoy to 1.34.11
github.com/envoyproxy/envoy fixed: 1.33.13
Upgrade github.com/envoyproxy/envoy to 1.33.13
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/envoyproxy/envoy

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-66220, inspect your project dependencies for Github.com/envoyproxy/envoy:

inspect dependencies for github.com/envoyproxy/envoy

Analyze the terminal output to locate any version of Github.com/envoyproxy/envoy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.36.3), 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-170: Improper Null Termination, where the product does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator. In Github.com/envoyproxy/envoy, 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

### Summary Envoy’s mTLS certificate matcher for `match_typed_subject_alt_names` may incorrectly treat certificates containing an embedded null byte (\0) inside an `OTHERNAME` SAN value as valid matches. ### Details This occurs when the SAN is encoded as a `BMPSTRING` or `UNIVERSALSTRING`, and its UTF-8 conversion result is truncated at the first null byte during string assignment. As a result, `"victim\0evil"` may match an exact: `"victim"` rule and be accepted by Envoy. ### PoC Create a CA and a server certificate signed by that CA. Create two client certificates signed by the same CA: client_evil with OTHERNAME BMPSTRING = "evil" client_null with OTHERNAME BMPSTRING = "victim\0evil" Configure Envoy with require_client_certificate: true and a match_typed_subject_alt_names entry for the OTHERNAME OID with matcher.exact: "victim". Connect without a client cert → connection rejected. Connect with client_evil → connection rejected. Connect with client_null → connection accepted (but shouldn't!). ### Impact An attacker who can obtain a trusted client certificate with a null byte embedded in an OTHERNAME SAN can exploit this vulnerability. The practical impact is unauthorized impersonation of the matched identity, enabling access to services or APIs protected by that exact OTHERNAME check. ### Credit [markevich.nikita1@gmail.com](mailto:markevich.nikita1@gmail.com)

CVE-2025-66220 Affected Github.com/envoyproxy/envoy Versions

4 component(s)
Fixed Versions:
1.36.31.35.71.34.111.33.13
Product / Package Ecosystem Affected Versions Fixed Version
github.com/envoyproxy/envoy
Go
≥ 1.36.0
< 1.36.3
1.36.3
github.com/envoyproxy/envoy
Go
≥ 1.35.0
< 1.35.7
1.35.7
github.com/envoyproxy/envoy
Go
≥ 1.34.0
< 1.34.11
1.34.11
github.com/envoyproxy/envoy
Go
< 1.33.13
1.33.13

References

Frequently Asked Questions

What is CVE-2025-66220?
CVE-2025-66220 is a security vulnerability in Github.com/envoyproxy/envoy involving Envoy's TLS certificate matcher for `match_typed_subject_alt_names` may incorrectly treat certificates containing an embedded null byte under CWE-170: Improper Null Termination.
Which Github.com/envoyproxy/envoy versions are affected?
Affected versions include releases prior to 1.36.3, 1.35.7, 1.34.11, 1.33.13 across affected packages: github.com/envoyproxy/envoy.
What version fixes CVE-2025-66220?
Upgrading to 1.36.3, 1.35.7, 1.34.11, 1.33.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/envoyproxy/envoy affected?
Yes, github.com/envoyproxy/envoy is affected in releases prior to 1.36.3, 1.35.7, 1.34.11, 1.33.13. Upgrade your dependency to 1.36.3, 1.35.7, 1.34.11, 1.33.13 or later.
What is the CVSS score of CVE-2025-66220?
CVE-2025-66220 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2025-66220?
CVE-2025-66220 is classified under CWE-170: Improper Null Termination (The product does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.).
How can I check Go dependencies for CVE-2025-66220?
Run the dependency tree command: 'inspect dependencies for github.com/envoyproxy/envoy'. 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-rwjg-c3h2-f57p",
  "modified" : "2025-12-05T18:14:03Z",
  "published" : "2025-12-05T18:14:02Z",
  "aliases" : [ "CVE-2025-66220" ],
  "summary" : "Envoy's TLS certificate matcher for `match_typed_subject_alt_names` may incorrectly treat certificates containing an embedded null byte",
  "details" : "### Summary\nEnvoy’s mTLS certificate matcher for `match_typed_subject_alt_names` may incorrectly treat certificates containing an embedded null byte (\\0) inside an `OTHERNAME` SAN value as valid matches.\n\n### Details\nThis occurs when the SAN is encoded as a `BMPSTRING` or `UNIVERSALSTRING`, and its UTF-8 conversion result is truncated at the first null byte during string assignment. As a result, `\"victim\\0evil\"` may match an exact: `\"victim\"` rule and be accepted by Envoy.\n\n### PoC\n\nCreate a CA and a server certificate signed by that CA.\nCreate two client certificates signed by the same CA:\nclient_evil with OTHERNAME BMPSTRING = \"evil\"\nclient_null with OTHERNAME BMPSTRING = \"victim\\0evil\"\nConfigure Envoy with require_client_certificate: true and a match_typed_subject_alt_names entry for the OTHERNAME OID with matcher.exact: \"victim\".\nConnect without a client cert → connection rejected.\nConnect with client_evil → connection rejected.\nConnect with client_null → connection accepted (but shouldn't!).\n\n### Impact\nAn attacker who can obtain a trusted client certificate with a null byte embedded in an OTHERNAME SAN can exploit this vulnerability. The practical impact is unauthorized impersonation of the matched identity, enabling access to services or APIs protected by that exact OTHERNAME check.\n\n### Credit\n[markevich.nikita1@gmail.com](mailto:markevich.nikita1@gmail.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/envoyproxy/envoy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.36.0"
      }, {
        "fixed" : "1.36.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.36.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/envoyproxy/envoy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.35.0"
      }, {
        "fixed" : "1.35.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.35.6"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/envoyproxy/envoy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.34.0"
      }, {
        "fixed" : "1.34.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.34.10"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/envoyproxy/envoy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.33.13"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.33.12"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/envoyproxy/envoy/security/advisories/GHSA-rwjg-c3h2-f57p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66220"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/envoyproxy/envoy"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-170" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-05T18:14:02Z",
    "nvd_published_at" : "2025-12-03T19:15:58Z"
  }
}