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

fix: prevent integer underflow in amount() bounds check

Public commit record

What the developer wrote

Authored by oblivionsage

85/100 · Strong
fix: prevent integer underflow in amount() bounds check

The bounds check 'index > arr.size() - 1' has an edge case bug.
When arr.size() is 0, subtracting 1 from an unsigned size_t
underflows to SIZE_MAX, so 'index > SIZE_MAX' is always false.

This could theoretically allow out-of-bounds access, though it's
pretty hard to trigger in practice - would need a malformed/corrupted
unsigned_tx file that parses successfully but has no transactions.

Changed to 'arr.empty() || index >= arr.size()' which handles
the edge case properly.

Found with AddressSanitizer during fuzzing.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
The short version

What changed, and why it matters

A single-line fix in Feather Wallet's unsigned-transaction handling corrects a bounds check that could fail when a transaction list is empty. The old check accidentally turned into 'always pass' for empty lists due to an unsigned integer underflow, which could let the program read past the end of an empty array and return garbage or crash. The fix makes the empty case explicit. The commit notes this was found by automated fuzzing and would require a malformed unsigned transaction file to trigger.

Recommended action

Apply the patch. Consider adding a regression unit test that calls amount(0) on an empty UnsignedTransaction and verify it returns 0 without sanitizer errors. Review nearby index/size_t arithmetic for similar patterns.

Security signals we found

01

Integer underflow in unsigned size_t arithmetic

02

Missing bounds check on zero-length container

03

Out-of-bounds read potential

04

Found via AddressSanitizer fuzzing

Risk score

Why this scored 45/100

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