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

silentpayments: reject label tweaks that overflow the group order

Public commit record

What the developer wrote

Authored by Sebastian Falbesoner

100/100 · Strong
silentpayments: reject label tweaks that overflow the group order

Previously, a label tweak returned by the `label_lookup` callback that
is not smaller than the group order was silently reduced modulo the
group order. Such a tweak can never be produced by
`secp256k1_silentpayments_recipient_label_create`, so it indicates a
corrupted or improperly constructed label cache, i.e., a bug on the
caller side rather than invalid data from an untrusted source. Treat
this as an API misuse (similar to the magic byte checks on the
`prevouts_summary` argument), and add a test.

The assignment of the found output is moved after the label tweak
check, so that the found_outputs[k] entry is left untouched if the
scan is aborted due to an invalid label tweak.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This change tightens error handling in the silent payments scanning code. Previously, if a caller-supplied label tweak was as large as or larger than the elliptic curve group order, it was silently wrapped around (reduced modulo the order). Now the function rejects such tweaks and aborts scanning. The tweak value comes from a caller-provided callback/cache, not from untrusted network data, so this is treated as a caller bug rather than an externally exploitable vulnerability. The patch also ensures that if this rejection happens, sensitive intermediate values are cleared from memory and the output entry is not partially written.

Recommended action

Review callers' label cache construction and serialization to ensure they cannot produce group-order-or-larger tweaks; the library now aborts on such input. No immediate network-facing mitigation is required because the input originates from caller-controlled state, not untrusted data.

Security signals we found

01

silent reduction modulo group order replaced with explicit overflow rejection

02

sensitive scalars and shared secret explicitly cleared before aborting on invalid input

03

output assignment reordered to avoid partial state update on failure path

04

new test injects group-order tweak and verifies API misuse rejection

Risk score

Why this scored 31/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 3/15
Affected reach 5/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.