Skip to content

Remove permitted.reduce(excluded) optimization in X.509 NameConstraints.#2803

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_935167126
Open

Remove permitted.reduce(excluded) optimization in X.509 NameConstraints.#2803
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_935167126

Conversation

@copybara-service

Copy link
Copy Markdown

Remove permitted.reduce(excluded) optimization in X.509 NameConstraints.

A logic flaw in the Sun PKIX CertPathValidator X.509 NameConstraints validation allows an attacker with a constrained intermediate CA to craft unauthorized certificates for arbitrary domains and perform TLS Man-in-the-Middle (MITM) attacks. Specifically, an optional optimization using permitted.reduce(excluded) could remove the last permitted subtree of a specific type. This caused the verify() method to incorrectly short-circuit and approve the certificate, effectively dropping the name constraint.

To resolve this issue, this commit removes the permitted.reduce(excluded) optimization from NameConstraintsExtension.java and Builder.java. Because this step was strictly an optimization and not required for algorithmic correctness, removing it ensures that constraints are properly retained and correctly enforced during certificate path validation.

Test: built and verified locally
FEATURE: N/A
RELNOTES: Remove permitted.reduce(excluded) optimization in X.509 NameConstraints path validation to prevent constraint bypass.

A logic flaw in the Sun PKIX CertPathValidator X.509 NameConstraints validation allows an attacker with a constrained intermediate CA to craft unauthorized certificates for arbitrary domains and perform TLS Man-in-the-Middle (MITM) attacks. Specifically, an optional optimization using permitted.reduce(excluded) could remove the last permitted subtree of a specific type. This caused the verify() method to incorrectly short-circuit and approve the certificate, effectively dropping the name constraint.

To resolve this issue, this commit removes the permitted.reduce(excluded) optimization from NameConstraintsExtension.java and Builder.java. Because this step was strictly an optimization and not required for algorithmic correctness, removing it ensures that constraints are properly retained and correctly enforced during certificate path validation.

Test: built and verified locally
FEATURE: N/A
RELNOTES: Remove permitted.reduce(excluded) optimization in X.509 NameConstraints path validation to prevent constraint bypass.
PiperOrigin-RevId: 935167126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant