/

CVE-2026-63576

Severity:

HIGH RISK

(7.5)

Certificate Validation Bypass (CWE-295) in BC-CSharp

CVE-2026-63576

Analyzed

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

Certificate Validation Bypass

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Bouncy Castle for C# contains an improper certificate validation flaw in URI name-constraint processing. A crafted subjectAltName URI may cause the validator to compare constraints against an incorrectly extracted host, potentially allowing a certificate that should be rejected to pass certification path validation.

Bouncy Castle for C# contains an improper certificate validation flaw in URI name-constraint processing. A crafted subjectAltName URI may cause the validator to compare constraints against an incorrectly extracted host, potentially allowing a certificate that should be rejected to pass certification path validation.

Affected context

The issue affects applications using Bouncy Castle's C# PKIX certification path validation with permitted or excluded uniformResourceIdentifier name constraints. Risk is higher when certificate chains include a name-constrained subordinate CA and certificate subjectAltName values are obtained from, or influenced by, an untrusted certificate issuer.

The issue affects applications using Bouncy Castle's C# PKIX certification path validation with permitted or excluded uniformResourceIdentifier name constraints. Risk is higher when certificate chains include a name-constrained subordinate CA and certificate subjectAltName values are obtained from, or influenced by, an untrusted certificate issuer.

Exploit preconditions

  • Attack surface: Certificate path validation involving URI name constraints
  • Required access: Ability to issue, obtain, or introduce a certificate containing a chosen subjectAltName URI through a name-constrained subordinate CA
  • Trigger point: Processing the URI during PKIX name-constraint validation
  • Why exploitation is possible: Host extraction relies on string slicing before correctly isolating the RFC 3986 authority component, so characters in URI userinfo, path, query, or fragment data can affect the host value compared with the actual URI authority
  • Attack surface: Certificate path validation involving URI name constraints
  • Required access: Ability to issue, obtain, or introduce a certificate containing a chosen subjectAltName URI through a name-constrained subordinate CA
  • Trigger point: Processing the URI during PKIX name-constraint validation
  • Why exploitation is possible: Host extraction relies on string slicing before correctly isolating the RFC 3986 authority component, so characters in URI userinfo, path, query, or fragment data can affect the host value compared with the actual URI authority

Why this happens

The underlying bug is improper validation of certificate identity data under CWE-295: Improper Certificate Validation. The validator derives a host by slicing a URI string without first parsing its authority component according to URI syntax. As a result, delimiter characters such as @ or : can cause the value compared with name constraints to differ from the URI's actual host, weakening the intended certification-path policy.

The underlying bug is improper validation of certificate identity data under CWE-295: Improper Certificate Validation. The validator derives a host by slicing a URI string without first parsing its authority component according to URI syntax. As a result, delimiter characters such as @ or : can cause the value compared with name constraints to differ from the URI's actual host, weakening the intended certification-path policy.

Potential impact

  • A certificate that violates permitted or excluded URI name constraints may be accepted
  • Applications may establish trust in an unintended certificate subject or endpoint
  • TLS, signing, or other certificate-based trust decisions could be weakened
  • Downstream authorization or identity checks may rely on a certificate chain that should have been rejected
  • A certificate that violates permitted or excluded URI name constraints may be accepted
  • Applications may establish trust in an unintended certificate subject or endpoint
  • TLS, signing, or other certificate-based trust decisions could be weakened
  • Downstream authorization or identity checks may rely on a certificate chain that should have been rejected

General mitigation guidance

Mitigation generally focuses on using a maintained cryptographic validation implementation with standards-compliant URI parsing and certificate constraint handling.

Defensive patterns include:

  • Ensure certificate path validation parses URI authority components according to the applicable URI standard before applying constraints
  • Prefer safe, standards-conformant library behavior over custom string-based host extraction
  • Treat certificate subjectAltName values and subordinate CA issuance policies as untrusted inputs
  • Apply explicit constraints on which subordinate CAs may issue certificates and which URI namespaces they may use
  • Use least privilege and narrow trust stores for services that perform certificate validation
  • Add regression tests covering URI userinfo, port, path, query, and fragment delimiters

Mitigation generally focuses on using a maintained cryptographic validation implementation with standards-compliant URI parsing and certificate constraint handling.

Defensive patterns include:

  • Ensure certificate path validation parses URI authority components according to the applicable URI standard before applying constraints
  • Prefer safe, standards-conformant library behavior over custom string-based host extraction
  • Treat certificate subjectAltName values and subordinate CA issuance policies as untrusted inputs
  • Apply explicit constraints on which subordinate CAs may issue certificates and which URI namespaces they may use
  • Use least privilege and narrow trust stores for services that perform certificate validation
  • Add regression tests covering URI userinfo, port, path, query, and fragment delimiters

How teams detect issues like this

Detection can combine dependency inventory with validation-focused testing and code review.

Useful approaches include:

  • Identify uses of affected Bouncy Castle C# components in dependency and software composition inventories
  • Review certificate validation code for string slicing or delimiter-based host extraction
  • Test permitted and excluded URI name constraints with authority components containing userinfo, ports, paths, queries, and fragments
  • Add policy checks requiring standards-compliant URI parsing and rejection of ambiguous certificate identities
  • Monitor certificate issuance and chain-validation failures for unexpected URI namespace activity
  • Use static analysis or automated code review tools to flag custom certificate validation and URI parsing logic

Detection can combine dependency inventory with validation-focused testing and code review.

Useful approaches include:

  • Identify uses of affected Bouncy Castle C# components in dependency and software composition inventories
  • Review certificate validation code for string slicing or delimiter-based host extraction
  • Test permitted and excluded URI name constraints with authority components containing userinfo, ports, paths, queries, and fragments
  • Add policy checks requiring standards-compliant URI parsing and rejection of ambiguous certificate identities
  • Monitor certificate issuance and chain-validation failures for unexpected URI namespace activity
  • Use static analysis or automated code review tools to flag custom certificate validation and URI parsing logic

Sources

SourceLink
github.comgithub.com/bcgit/bc-csharp/commit/f196a22bbf7765cc19b0c4f4645c74ea7ad35e09
github.comgithub.com/bcgit/bc-csharp/wiki/CVE-2026-63576

Frequently asked

questions

It can affect remote trust decisions when an application validates attacker-controlled or externally supplied certificate chains. Exploitation still depends on the attacker obtaining an appropriate certificate through a trusted or name-constrained subordinate CA.

No direct access to the validator is necessarily required. The relevant prerequisite is the ability to introduce a certificate containing a URI value that reaches the affected certification-path validation logic.

Use a maintained implementation with standards-compliant URI authority parsing and correct name-constraint enforcement. Avoid custom string-based certificate or URI validation logic.

Maintain narrowly scoped trust stores, restrict subordinate CA issuance policies, test edge-case URI syntax, and include certificate validation behavior in security regression and dependency review processes.

It can affect remote trust decisions when an application validates attacker-controlled or externally supplied certificate chains. Exploitation still depends on the attacker obtaining an appropriate certificate through a trusted or name-constrained subordinate CA.

No direct access to the validator is necessarily required. The relevant prerequisite is the ability to introduce a certificate containing a URI value that reaches the affected certification-path validation logic.

Use a maintained implementation with standards-compliant URI authority parsing and correct name-constraint enforcement. Avoid custom string-based certificate or URI validation logic.

Maintain narrowly scoped trust stores, restrict subordinate CA issuance policies, test edge-case URI syntax, and include certificate validation behavior in security regression and dependency review processes.

Find out what's already
exploitable in your codebase.