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

fix(solana): properly sanitize account counts

Public commit record

What the developer wrote

Authored by Jakub Janků

88/100 · Strong
fix(solana): properly sanitize account counts

The parsed address counts were previously checked only using asserts
which are stripped out in release builds. As a result, the device could
misclassify the accounts in a TX and present a writable signer as
read-only. However, no funds were at risk, since a TX with invalid counts
is rejected by the network.

Moreover, one asserted bound was incorrect, at least one writable signer
must be present in each TX (the fee payer).

This commit replaces the asserts with proper if-raise checks that now
mirror the on-chain checks, see:

https://github.com/anza-xyz/solana-sdk/blob/06b8acf9dfc505da943e25274454a95a5bdaa42a/message/src/legacy.rs#L166-L178
https://github.com/anza-xyz/solana-sdk/blob/06b8acf9dfc505da943e25274454a95a5bdaa42a/message/src/versions/v0/mod.rs#L126-L138

[no changelog]
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in how Trezor's Solana app counted account roles inside a transaction. In release builds, safety checks were removed, so a malformed transaction could trick the device into showing a signer account as read-only on screen. The device would not actually sign anything harmful, because the Solana network would reject the bad transaction anyway. The fix replaces the removed checks with proper error handling and corrects one rule: every transaction must have at least one writable signer to pay fees.

Recommended action

No immediate user action is required because the network rejects malformed transactions. Users should ensure their firmware is updated to a version containing this commit to prevent any confusion from incorrect on-screen account labels.

Security signals we found

01

assert replaced with explicit runtime validation

02

incorrect bound on writable signer count corrected

03

validation aligned with upstream Solana SDK message checks

04

potential UI misclassification of signer as read-only in release builds

Risk score

Why this scored 40/100

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