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

Reject quantity of 0 for offers with bounded quantity

Public commit record

What the developer wrote

Authored by Jeffrey Czyz

85/100 · Strong
Reject quantity of 0 for offers with bounded quantity

An offer advertising Quantity::Bounded expects at least one item, but
is_valid_quantity accepted a quantity of 0 since it only checked the
upper bound. Require the quantity to be greater than 0 so that an
invoice request for 0 items is rejected as an InvalidQuantity.

Co-Authored-By: Claude <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a validation bug in rust-lightning's BOLT12 offer handling. An offer that says 'buy up to N items' was accidentally accepting requests to buy 0 items, which is meaningless and could let someone request an invoice for nothing. The fix now rejects zero-quantity requests for bounded-quantity offers, matching the intended behavior.

Recommended action

Review whether any other quantity-related edge cases (e.g., overflow, quantity == 0 with other quantity types) are handled consistently. No immediate emergency action is indicated, but users processing BOLT12 offers should update to include this validation fix.

Security signals we found

01

Input validation bug in BOLT12 offer quantity parsing

02

Zero-value / zero-quantity invoice request accepted when it should be rejected

03

Semantic validation fix with regression test

Risk score

Why this scored 41/100

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