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

fix(solana): make compact-u16 parsing strict

Public commit record

What the developer wrote

Authored by Jakub Janků

80/100 · Strong
fix(solana): make compact-u16 parsing strict

parse_var_int returned a partial value (or 0) on truncated input and
accepted non-canonical and overlong encodings, e.g. a v0 transaction
missing its lookup table count parsed as having no tables. It now
mirrors solana-sdk's short_vec decoding.

[no changelog]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✓ 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

This commit fixes the way Trezor's Solana app reads compact (variable-length) integer counts from transaction data. Previously, the parser would silently accept malformed or truncated numbers, which could make a transaction with missing data appear valid. The fix now rejects non-standard encodings, truncated inputs, and values that are too large, matching the behavior of Solana's official SDK.

Recommended action

Review whether the old `parse_var_int` behavior could have led to incorrect transaction display or signing decisions in Solana transactions, especially for address lookup table counts and account/instruction counts. Consider a security advisory if a malformed transaction could cause the device to sign something the user did not intend. Ensure the new strict parser is backported to supported firmware branches and that test vectors are run in CI.

Security signals we found

01

Strict compact-u16 parsing prevents malleability and truncation-based misinterpretation of Solana transaction fields.

02

Old parser could return 0 or partial values on truncated input, potentially causing a v0 transaction missing its lookup table count to be parsed as having no lookup tables.

03

Non-canonical encodings were previously accepted, violating Solana SDK short_vec semantics.

04

Value overflow check (> 0xFFFF) is retained and now reached only after a valid 3-byte encoding.

05

No changelog entry is explicitly marked with [no changelog].

Risk score

Why this scored 61/100

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