Skip to content

crypto/x509: ParseOID is slow on very large textual OID components #79868

Description

@jvdprng

Description

ParseOID accepts textual OID input and converts decimal components into DER. Very large decimal components can make parsing unexpectedly slow and allocation-heavy. No concrete remote trust boundary or security impact has been shown.

This is separate from binary DER OID parsing; it concerns textual OID APIs.

Specification or documentation

This is primarily a Go API robustness and performance edge case. The API does not document resource limits for unusually large textual OID components.

Code references

  • go/src/crypto/x509/oid.go:27 defines ParseOID.
  • go/src/crypto/x509/oid.go:92 through go/src/crypto/x509/oid.go:95 shows big-integer DER length handling used for large components.
  • go/src/crypto/x509/oid.go:180 through go/src/crypto/x509/oid.go:184 appends base-128 big integer encodings into the OID DER buffer.

Test case

This should be a Go unit or fuzz regression test for ParseOID, using an input such as 1.2. followed by thousands of decimal digits. The expected behavior should be either successful parsing within reasonable bounds or a clear error without avoidable quadratic work.

It could be a parser fuzz-corpus seed for the OID text APIs.

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