You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was reported by Gregor Kopf for Cure53. Thanks Gregor!
RFC 5280 has this to say about IP address name constraints:
For IPv4 addresses, the iPAddress field of GeneralName MUST contain eight (8) octets, encoded in the style of RFC 4632 (CIDR) to represent an address range [RFC4632]. For IPv6 addresses, the iPAddress field MUST contain 32 octets similarly encoded. For example, a name constraint for "class C" subnet 192.0.2.0 is represented as the octets C0 00 02 00 FF FF FF 00, representing the CIDR notation 192.0.2.0/24 (mask 255.255.255.0).
"... would support non-contiguous subnet masks - i.e., masks that have one-bits after the first zero bit. I know that the respective RFCs are not too clear about whether such masks should be allowed or not."
The question is whether it is correct (or at least better) to support non-contiguous subnet masks or to reject non-contiguous masks. Even more than that, should we support masks that aren't prefixes?
I don't remember making a conscious decision about this in the past. The RFC 5280 encoding of subnet mask is wasteful and error-prone if it really intends to be restricted to masks that can be represented in CIDR notation. OTOH we don't have any motivation to support masks that can't be represented with CIDR notation. webpki should align with Chromium here.
The text was updated successfully, but these errors were encountered:
I want to emphasize that the severity of this issue is very low due to the points I already shared above:
webpki doesn't (yet) support validating a certificate for an IP address yet: webpki/cert: extend verify_is_valid_for to iPAddress SAN #54. So using webpki to validate a certificate, you'll never run into the situation where a malformed IP address name constraint caused you to accept a certificate for an IP address that should have been masked off in the constraint.
The name constraint is in the CA certificate, and so a wrong mask would be an error on the CA's part. The threat model for certificate validation requires us to trust the CA.
To help people feel better about the IP address support we're planning to add to resolve #54, we should add a check that the mask is contiguous, probably by helping @djc get his PR merged.
This was reported by Gregor Kopf for Cure53. Thanks Gregor!
RFC 5280 has this to say about IP address name constraints:
Gregor noted that this code:
webpki/src/name.rs
Lines 357 to 375 in 049c5ad
The question is whether it is correct (or at least better) to support non-contiguous subnet masks or to reject non-contiguous masks. Even more than that, should we support masks that aren't prefixes?
Chromium's name constraint logic does have these requirements. See https://chromium.googlesource.com/chromium/src/+blame/51ba3e6902ecd7284d3be51db648127d1be2187f/net/cert/internal/name_constraints.cc#239
I don't remember making a conscious decision about this in the past. The RFC 5280 encoding of subnet mask is wasteful and error-prone if it really intends to be restricted to masks that can be represented in CIDR notation. OTOH we don't have any motivation to support masks that can't be represented with CIDR notation. webpki should align with Chromium here.
The text was updated successfully, but these errors were encountered: