Description
VerifyOptions.MaxConstraintComparisions is documented as a limit on name-constraint comparison work in the pure-Go verifier, with TooManyConstraints as the corresponding failure reason. The finding indicates that the documented limit is not enforced in the relevant pure-Go verification path.
This is a documented-option bug rather than a demonstrated vulnerability.
Specification or documentation
This is primarily a Go API documentation/behavior mismatch. The relevant public documentation says the limit prevents pathological certificates from consuming excessive CPU while validating.
Code references
go/src/crypto/x509/verify.go:51 through go/src/crypto/x509/verify.go:56 documents the TooManyConstraints invalid reason.
go/src/crypto/x509/verify.go:214 through go/src/crypto/x509/verify.go:219 documents VerifyOptions.MaxConstraintComparisions.
go/src/crypto/x509/constraints.go:416 is in the name-constraint checking code path.
Test case
This should be an X.509 verification unit test: construct a chain with enough permitted/excluded names to exceed a very small MaxConstraintComparisions value and assert that Verify returns TooManyConstraints.
It could be added as an X.509 verification regression test.
Description
VerifyOptions.MaxConstraintComparisionsis documented as a limit on name-constraint comparison work in the pure-Go verifier, withTooManyConstraintsas the corresponding failure reason. The finding indicates that the documented limit is not enforced in the relevant pure-Go verification path.This is a documented-option bug rather than a demonstrated vulnerability.
Specification or documentation
This is primarily a Go API documentation/behavior mismatch. The relevant public documentation says the limit prevents pathological certificates from consuming excessive CPU while validating.
Code references
go/src/crypto/x509/verify.go:51throughgo/src/crypto/x509/verify.go:56documents theTooManyConstraintsinvalid reason.go/src/crypto/x509/verify.go:214throughgo/src/crypto/x509/verify.go:219documentsVerifyOptions.MaxConstraintComparisions.go/src/crypto/x509/constraints.go:416is in the name-constraint checking code path.Test case
This should be an X.509 verification unit test: construct a chain with enough permitted/excluded names to exceed a very small
MaxConstraintComparisionsvalue and assert thatVerifyreturnsTooManyConstraints.It could be added as an X.509 verification regression test.