Skip to content

Reject overflowing numeric OID components - #10911

Open
subotac wants to merge 1 commit into
Mbed-TLS:developmentfrom
subotac:fix/numeric-oid-overflow
Open

Reject overflowing numeric OID components#10911
subotac wants to merge 1 commit into
Mbed-TLS:developmentfrom
subotac:fix/numeric-oid-overflow

Conversation

@subotac

@subotac subotac commented Aug 10, 2026

Copy link
Copy Markdown

Description

oid_parse_number() checked the accumulated value before multiplying by 10,
but did not account for the pending digit. Numeric components such as
4294967296 could therefore wrap and be accepted as a different OID value.

Validate the complete multiply-add before updating the accumulator, and add
regression cases for overflow to zero, overflow to a nonzero value, and
continued parsing after a wrap.

Fixes #10910

PR checklist

  • changelog provided
  • framework PR not required because: no framework changes
  • TF-PSA-Crypto development PR not required because: no TF-PSA-Crypto changes
  • TF-PSA-Crypto 1.1 PR not required because: no TF-PSA-Crypto changes
  • mbedtls development PR this PR
  • mbedtls 4.1 PR to be provided after the development fix is accepted
  • mbedtls 3.6 PR to be provided after the development fix is accepted
  • tests provided

Signed-off-by: subotac <73706465+subotac@users.noreply.github.com>
@gilles-peskine-arm gilles-peskine-arm added needs-review Every commit must be reviewed by at least two team members, component-x509 needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) labels Aug 10, 2026
@gilles-peskine-arm gilles-peskine-arm moved this to Scoped in Community Aug 10, 2026
@gilles-peskine-arm gilles-peskine-arm added the needs-ci Needs to pass CI tests label Aug 10, 2026
@gilles-peskine-arm gilles-peskine-arm moved this from Scoped to Triage in in Community Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component-x509 needs-ci Needs to pass CI tests needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)

Projects

Status: Triage in
Status: In Development

Development

Successfully merging this pull request may close these issues.

mbedtls_oid_from_numeric_string() accepts wrapping numeric strings, silently encoding a different OID

2 participants