AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 59 Bitcoin

otp: be more strict parsing counter/period.

Public commit record

What the developer wrote

Authored by Jon Griffiths

76/100 · Adequate
otp: be more strict parsing counter/period.

Suggested-by: Jordan Mecom (@jmecom) via https://github.com/jmecom/odo

Adds a parse_uint64 to parse decimal unsigned integers.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit tightens how Blockstream Jade handles the numbers inside OTP setup URLs (the 'counter' for HOTP codes and the 'period' for TOTP codes). Before the change, the code copied the number into a small temporary buffer and converted it with standard C library functions, which could silently accept non-digit characters, ignore overflow, or be fed an oversized input. The patch adds a strict decimal parser that only accepts digits, rejects values too large for the variable, and enforces length limits. The commit message credits the change to an external suggestion, but does not call it a security fix.

Recommended action

Treat as a defensive hardening patch. Review whether the prior lenient parsing could have led to unexpected OTP behavior or denial of service, and consider whether additional OTP URI fields (e.g., digits, algorithm) need similar strict parsing. No urgent exploit mitigation is evident from the diff alone.

Security signals we found

01

Replaces unsafe strtoull/strtoul parsing of untrusted URI query parameters with strict bounded decimal parser

02

Adds explicit length and overflow checks for numeric OTP parameters

03

Adds regression tests for malformed counter/period values

04

Suggested-by external contributor, indicating independent review

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.