Skip to content

crypto/x509: MaxConstraintComparisions is documented but not enforced #79864

Description

@jvdprng

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions