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

feat(solana): warn about hooks on Transfer Checked with trailing accounts

Public commit record

What the developer wrote

Authored by Jakub Janků

100/100 · Strong
feat(solana): warn about hooks on Transfer Checked with trailing accounts

Token-2022 mints can carry the transfer hook extension, which makes
Transfer Checked CPI into a mint-configured hook program. The hook
program (and any extra accounts it requires) is passed to the
instruction as trailing accounts after the owner/multisig signers, so
a transfer that executes a hook always carries at least one trailing
account; conversely, without trailing accounts the hook CPI cannot
succeed (see add_extra_accounts_for_execute_cpi in
spl-transfer-hook-interface, which requires the hook program account
among the additional accounts).

Warn the user before displaying the trailing accounts of a Token-2022
Transfer Checked instruction: a hook may impose additional
restrictions or fees on the transfer and would otherwise execute
without any indication that a third-party program runs. The deprecated
Transfer instruction needs no warning, as it can never execute hooks
(Token-2022 aborts with MintRequiredForTransfer when the source
account carries the hook extension and no mint is provided).

The warning is defined in programs.json as a new optional
per-instruction field `trailing_accounts_warning`, displayed only when
the instruction carries trailing accounts. This mirrors the existing
`is_deprecated_warning` mechanism: the warning text lives in the
instruction definitions and is rendered via confirm_metadata under the
instruction's title.

Partially fixes: https://github.com/satoshilabs/trezor-firmware/issues/325

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit ee443c5d09bdfd867c7cd93c812a9e4abc5460ed)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit adds a new on-screen warning for Trezor users when they are about to sign a specific Solana token transfer that includes extra accounts. Those extra accounts can mean a third-party 'transfer hook' program is triggered, potentially adding hidden fees or restrictions. The change is a user-interface improvement to prevent users from unknowingly approving such transfers, not a fix for a code execution bug in Trezor itself.

Recommended action

Users should ensure firmware is updated so they receive the new warning. Developers should consider whether further hardening is needed, such as requiring explicit opt-in for transfer-hook-bearing transfers or validating that trailing accounts match expected hook program accounts, because this patch only warns and does not prevent signing.

Security signals we found

01

New user-facing warning for third-party program invocation

02

Token-2022 transfer hook extension behavior acknowledged

03

UI-only mitigation; no enforcement or validation of hook accounts

04

Partial fix for issue #325 (informational layer only)

05

Changelog entry tagged as security-relevant

Risk score

Why this scored 51/100

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