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

eth: implement data producer for streaming

Public commit record

What the developer wrote

Authored by Tomas Vrba

80/100 · Strong
eth: implement data producer for streaming

Implements the DataProducer trait with two implementations:
- SimpleProducer: Returns all data in one call (for small data)
- ChunkingProducer: Fetches data in 4096-byte chunks via IPC (for large data)

Updates DataProducer::next() to return Result<Option<Vec<u8>>, Error>
instead of Option<Vec<u8>> for proper error handling.

Updates sighash computation functions (compute_legacy, compute_eip1559) to:
- Accept DataProducer via RefCell for async access
- Propagate errors through the call chain
- Use the Write trait to stream data into the hasher

Updates sign.rs hash functions to use ChunkingProducer when
data_length > 0, otherwise use SimpleProducer with inline data.
✓ 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 adds support for signing Ethereum transactions with very large 'data' fields by streaming the data in 4 KB chunks instead of loading it all at once. It also adds safety checks: streamed and inline data cannot both be provided, and streamed data is capped at 1 MB. The change is a feature/refactoring with embedded defensive checks, but it is not described by the vendor as a security fix.

Recommended action

Review the IPC request/response pairing for the new DataRequestChunk/DataResponseChunk messages to ensure the host cannot inject malformed chunks, truncate responses, or cause the device to hash different data than the user approved. Verify that the 1 MB cap and chunk-length validation are enforced in all code paths and that the UI confirmation accurately reflects the data being signed.

Security signals we found

01

Adds streaming/chunking of large transaction data to avoid loading up to 1 MB into memory at once

02

Adds mutual-exclusion check preventing both inline `data` and `data_length` streaming from being active simultaneously

03

Adds explicit size caps: 6144 bytes for inline data, 1 MB for streamed data

04

Propagates errors from IPC chunking through the sighash call chain instead of silently ignoring failures

05

Validates received chunk length matches requested chunk length and rejects wrong response types

06

Changes user confirmation message for large streamed data to indicate size rather than showing raw hex

Risk score

Why this scored 34/100

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