Repository navigation
x509: reject ambiguous leading-zero IPv4 references - #12609
Open
ripatel-fd wants to merge 1 commit into
Open
ripatel-fd wants to merge 1 commit into
ripatel-fd wants to merge 1 commit into
Conversation
┌─ ⚡ PERF · 10dbc2e vs main@43ef974 ─────────────────────────────────
│ SUITE BASELINE NEW Δ
│ replay tps, mainnet 13,849 tps 13,744 tps · -0.75%
│ bench tps, localnet 888,944 tps 894,248 tps · +0.60%
│ snapshot load, testnet 4.91 s 4.90 s · -0.16%
│ epoch boundary, mainnet 146.4 ms 145.9 ms · -0.33%
│ mem total, mainnet 147.34 GiB 147.34 GiB · 0.00%
│ mem total, testnet 84.66 GiB 84.66 GiB · 0.00%
│ clean compile, firedancer 3.14 s 3.12 s · -0.64%
│ binary size, firedancer 57.95 MB 57.95 MB · 0.00%
├─────────────────────────────────────────────────────────────────────
@@ 0 REGRESSIONS · 0 WARNINGS · 0 IMPROVED · 8 NOISE @@
└───────────────────────────────────────────────────────────────────── |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical validation bypass remains because leading-zero IP references can still match dNSName SANs when they fall outside the decimal-parsing or length checks that gate rejection.
1 open issue
What changed in this PR
This PR hardens X.509 certificate hostname verification against leading-zero IPv4 references that resolvers may interpret as octal.
Changes:
- Adds leading-zero octet rejection after successful IPv4 parsing.
- Adds tests for ambiguous references, canonical IPv4 addresses, and DNS names with leading-zero labels.
| File | Description |
|---|---|
src/ballet/x509/test_x509_verify.c |
Adds regression cases for IPv4 ambiguity and valid reference names. |
src/ballet/x509/fd_x509.c |
Adds a leading-zero check to IPv4 SAN matching. |
Review effort: Balanced
Comment on lines
+1209
to
+1211
| for( ulong i=0UL; i<hostname_len; i++ ) { | ||
| if( ( !i || hostname[ i-1UL ]=='.' ) && hostname[ i ]=='0' && | ||
| i+1UL<hostname_len && hostname[ i+1UL ]!='.' ) return 0; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.