Files
Groene AI b906bc5c09 Enforce single-component matching for SSL certificate wildcards
A '*' in an ssl_certificate user subject was constrained only by an
equal-slash-count check ("'*' must not represent a '/' in URI"). For CN
and "DNS:" SAN subjects there are no slashes, so the check was always
0 == 0 and did nothing. A user identified by '*.corp.example.com' was
therefore matched by any subject ending in '.corp.example.com',
including multi-label names like 'evil.deep.corp.example.com'. An
attacker able to obtain a CA-signed certificate for a deeper subdomain
could authenticate as the wildcard user.

Per RFC 6125 6.4.3 a wildcard must match exactly one component.
Generalize the separator to be type-aware: '.' for CN and "DNS:" SANs
(DNS label separator), '/' for "URI:" SANs (path separator, preserving
the previous behavior exactly). The matched span between the fixed
prefix and suffix must not contain the separator.

The candidate length is checked before computing the matched span so
its length cannot underflow when the prefix and suffix overlap on a
short candidate (e.g. pattern 'a*a', candidate 'a'), which also removes
a pre-existing overlap false positive. For URI SANs, "matched span has
no '/'" is equivalent to the previous equal-slash-count guard, so
existing URI wildcard behavior is unchanged.

Add integration tests covering DNS and CN wildcards (single-label
positive, multi-label bypass rejected) and a URI SAN whose matched
segment contains a dot (non-regression).
2026-06-25 12:29:07 +00:00

28 lines
1.6 KiB
Plaintext

-----BEGIN CERTIFICATE REQUEST-----
MIIEnDCCAoQCAQAwVzELMAkGA1UEBhMCUlUxEzARBgNVBAgMClNvbWUtU3RhdGUx
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEQMA4GA1UEAwwHY2xp
ZW50OTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOIP2oZETQjJhZv1
cV84AGnhrmklNq97iBmZVVk5EwqsLKMBl+I9XdQn5edU0jBFuCZII0LIY8HIkMyG
nIhyRBohgqSdMx9wFmSwNwofeawu6PhqCk9vG3JhukM0ciMkcy8lFBdljmYsxIli
urCCk3abfqjkRacXYZnlCVtNI7UGFS6wx6NQYCnK39uSbL2ZyiDjeCo5BpOqVZhg
pbELeA4C6RMDeXE15LKC60V0ijBDxUDlll8bKHg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