Skip to content

Forward EPP client certificate chain validation status and hostnames - #3293

Merged
anomaly2104 merged 1 commit into
google:masterfrom
anomaly2104:epp-cert-chain-headers
Dec 4, 2026
Merged

anomaly2104 merged 1 commit into
google:masterfrom
anomaly2104:epp-cert-chain-headers

Conversation

@anomaly2104

@anomaly2104 anomaly2104 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Validate incoming EPP client certificate chains against the JVM default truststore after TLS handshake completion and forward the result along with extracted DNS hostnames to Nomulus, preparing for hostname-based EPP login authentication while keeping existing fingerprint-pinned connections working unchanged.

  • Add X.509 helpers in X509Utils for PKIX chain validation (using checkServerTrusted so publicly trusted serverAuth-only TLS certs are accepted), DNS SAN / CN-fallback hostname extraction (excluding wildcards for now), and 4 KB-bounded header formatting.
  • Run chain validation and hostname extraction in SslServerInitializer without failing handshakes on untrusted chains, and log the validation status, failure reason, and extracted hostnames in --SSL Information--.
  • Forward X-SSL-Certificate-Chain-Validated and X-SSL-Certificate-Hostnames from both the integrated EPP server and proxy EppServiceHandler.

BUG=http://b/573176897


This change is Reviewable

@anomaly2104
anomaly2104 requested a review from CydeWeys November 24, 2026 08:57
@anomaly2104
anomaly2104 force-pushed the epp-cert-chain-headers branch 2 times, most recently from ec26b30 to 9e48c39 Compare November 25, 2026 08:13

@CydeWeys CydeWeys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is very clean, well-structured, and thoroughly tested—the checkServerTrusted(..., "UNKNOWN") profile choice (preserving compatibility as public CAs drop clientAuth EKU while enforcing TLSServer CA-distrust policies and digitalSignature key usage), MAX_CERTIFICATE_CHAIN_LENGTH = 10 guard, single-pass per-connection header formatting, log sanitization, and core/proxy parity all look solid.

Requesting changes for one P1 PKI security issue: Subject CN fallback bypasses OpenJDK PKIX NameConstraints in four ways (details inline on X509Utils.java). Dropping CN fallback and extracting hostnames strictly from SAN dNSName entries per RFC 9525 §6.2 closes all four bypasses and simplifies X509Utils. I also left a couple of non-blocking hardening/operational notes and minor nits.

@anomaly2104
anomaly2104 force-pushed the epp-cert-chain-headers branch from 9e48c39 to 8e3361e Compare November 26, 2026 08:08
@anomaly2104
anomaly2104 force-pushed the epp-cert-chain-headers branch 2 times, most recently from d6bcbef to 6980cc0 Compare December 3, 2026 04:42

@CydeWeys CydeWeys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleanly addressing all Round 1 feedback—removing Subject CN fallback, explicitly disabling online revocation via PKIXBuilderParameters.setRevocationEnabled(false), adding the outer catch in SslServerInitializer, statically importing ZoneOffset.UTC, and resolving the CodeQL findings all look clean. The networking/, proxy/, and core/ changes look solid overall.

Requesting changes for one remaining P1 PKI security issue in X509Utils.normalizeCertificateHostname (an OpenJDK PKIX NameConstraints excludedSubtrees bypass via trailing-dot SAN dNSName entries, plus a companion non-ASCII dNSName parser-differential hardening item). It's a small ~3-line fix, and please include dedicated unit tests covering both the trailing-dot and non-ASCII excludedSubtrees cases alongside the fix before we approve (especially with auto-merge enabled).

A couple of non-blocking PR-level notes:

  • Stale PR description (non-blocking): Bullet 1 of the PR description still references DNS SAN / CN-fallback hostname extraction and omits online revocation being explicitly disabled (the commit message is already updated). Please sync the PR description before merge while keeping the Reviewable footer intact.
  • Operational headroom note (non-blocking): With MAX_HOSTNAMES_HEADER_BYTES = 4096 and Jetty's default 8192-byte requestHeaderSize, the primary GKE --local sidecar path has ~2 KB of headroom under worst-case headers, whereas legacy standalone proxy + GCLB/IAP would leave only ~600–1,000 B (exceeding 8,192 B returns HTTP 431 and drops the EPP connection). Fits today, so non-blocking—just worth keeping in mind if standalone proxy + IAP remains active.

@CydeWeys CydeWeys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up from a deeper PKIX/TLS security audit on 6980cc0dd0ae75e3c0b5553c1d5ada85a9f186c6: found 2 additional blocking security issues in X509Utils (intermediate CA ExtendedKeyUsage bypass and an unauthenticated Netty EventLoop CPU/heap-exhaustion DoS via LazyX509Certificate re-parsing + SunCertPathBuilder backtracking), plus a companion SHA-1 signature hardening item (for distro-packaged openjdk-25-jre-headless / ca-certificates-java truststores without [jdk] alias tags) and one minor test note on SslServerInitializerTest.java:613.

Details, recommended fixes, and required unit tests for each security fix are inline below—please include dedicated test coverage for every security fix before we approve.

Validate incoming EPP client certificate chains against the JVM default
truststore after TLS handshake completion and forward the result along
with extracted DNS hostnames to Nomulus, preparing for hostname-based
EPP login authentication while keeping existing fingerprint-pinned
connections working unchanged.

- Add X.509 helpers in X509Utils for PKIX chain validation (with online
  revocation disabled, intermediate/leaf EKU and SHA-1 checks, 32 KB
  chain size and path-length bounds, and checkServerTrusted so publicly
  trusted serverAuth-only TLS certs are accepted), ASCII non-trailing-dot
  SAN dNSName hostname extraction (excluding wildcards and omitting
  Subject CN fallback per RFC 9525 section 6.2), and 4 KB-bounded header
  formatting.
- Run chain validation and hostname extraction in SslServerInitializer
  without failing handshakes on untrusted chains, and log the validation
  status, failure reason, and extracted hostnames in --SSL Information--.
- Forward X-SSL-Certificate-Chain-Validated and
  X-SSL-Certificate-Hostnames from both the integrated EPP server and
  proxy EppServiceHandler.

BUG=http://b/573176897
@anomaly2104
anomaly2104 force-pushed the epp-cert-chain-headers branch from 6980cc0 to dc7c7bf Compare December 4, 2026 08:20
@anomaly2104
anomaly2104 requested a review from CydeWeys December 4, 2026 10:35
@CydeWeys

CydeWeys commented Dec 4, 2026

Copy link
Copy Markdown
Member

The latest code and test changes look clean. One small non-blocking housekeeping request: please update the PR description to match the latest commit message (bullet 1 still references DNS SAN / CN-fallback hostname extraction, whereas Subject CN fallback has been removed in favor of SAN dNSName-only extraction).

@anomaly2104
anomaly2104 added this pull request to the merge queue Dec 4, 2026
Merged via the queue into google:master with commit 5c6180e Dec 4, 2026
15 of 16 checks passed
@anomaly2104
anomaly2104 deleted the epp-cert-chain-headers branch December 4, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants