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

fix(zcash): bound batch count before parsing

Public commit record

What the developer wrote

Authored by Adam Tucker

57/100 · Thin
fix(zcash): bound batch count before parsing
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
The short version

What changed, and why it matters

This commit adds a safety check for Zcash batch transactions on Keystone hardware wallets. Before fully parsing a batch of PCZT (Zcash transaction) data, the firmware now reads the declared number of items and rejects it if it exceeds 50. This prevents the parser from trying to allocate memory for an absurdly large number of items based solely on attacker-controlled input, which could cause memory exhaustion or a crash.

Recommended action

Review whether `ZCASH_BATCH_MAX_PCZTS = 50` aligns with realistic device memory limits and expected user workflows. Audit `BatchSignRequest::parse()` for other unbounded allocations. Ensure `postcard` is pinned to a reviewed version and that the `usize` deserialization cannot itself be abused (e.g., via multibyte varint edge cases). Consider fuzzing the batch request parser.

Security signals we found

01

Pre-allocation input validation: bounds a length field before parser allocation

02

Potential denial-of-service vector mitigated: oversized count could exhaust device memory

03

New dependency `postcard` introduced for controlled length decoding

04

Magic/header and version check before interpreting length field

05

Unit test added to verify count enforcement before full parse

Risk score

Why this scored 61/100

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