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

Additional validation in crypto_get_uncompressed_pubkey

Public commit record

What the developer wrote

Authored by Salvatore Ingala

55/100 · Thin
Additional validation in crypto_get_uncompressed_pubkey

Return with error if:
- x is too large
- x^3 + 7 is not a quadratic residue
✓ Specific, descriptive subject✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit tightens checks in a Ledger Bitcoin app function that converts compressed public keys into full (x,y) public key points. Previously, the code did not verify that the supplied x-coordinate is a valid field element (less than the curve prime p) and did not confirm that the computed y really satisfies the secp256k1 curve equation. The patch adds both checks, rejecting malformed keys. Without these checks, a specially crafted compressed key could cause the function to produce a point that is not actually on the Bitcoin curve, which could then be used in subsequent cryptographic operations in unexpected ways.

Recommended action

Treat this as a security hardening fix and include it in the next release. Review all call sites of crypto_get_uncompressed_pubkey to ensure return codes are checked and that no downstream code assumes the output is always on-curve. Consider whether other apps (e.g., Bitcoin forks) share the same helper and need an equivalent fix.

Security signals we found

01

Missing input validation on externally supplied compressed public key x-coordinate

02

Off-curve public-key point could be produced before patch

03

Out-of-range x-coordinate accepted before patch

04

Modular square root of non-residue not detected before patch

05

Patch adds explicit field-membership and quadratic-residue checks

Risk score

Why this scored 61/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/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.