fix(solana): don't present trailing accounts as multisig signers
What changed, and why it matters
This update fixes a Trezor Solana display bug that could mislead users into believing a transaction needed extra approvals when it did not. The device previously labeled any extra account attached to certain Solana instructions as a required 'Signer' and warned that the instruction was a multisig instruction, even when those accounts were not signers, not multisig members, or did not exist on-chain. The fix now shows each extra account with its real on-message flags (Writable/Signer), and removes the unverifiable per-instruction multisig warning. This prevents a malicious or buggy host app from making a single-signature transfer look like a multi-signature transfer.
Apply the patch and ensure users upgrade firmware. Wallet software hosts should also be reviewed to avoid constructing transactions that append misleading trailing accounts. Users should verify the actual 'requires N signers' transaction-level warning rather than any per-instruction label when approving Solana transactions.
Security signals we found
UI spoofing / misleading signer presentation
Host-supplied account metadata trusted without runtime verification
Per-instruction multisig warning asserted unverifiable on-chain state
Trailing accounts now rendered with message-level Writable/Signer flags
Changelog entry tagged as security fix
Evidence from the diff
The Trezor Solana app interpreted trailing account references in Token/Token-2022 instructions as multisig signers. It displayed them as ‘Signer N’ and emitted a per-instruction multisig warning, without checking the message-level signer flag or on-chain owner state. A host could therefore append arbitrary read-only accounts (silently ignored by the program unless they match a multisig member) or ALT-referenced accounts (which cannot sign) to a single-sig transfer, making it appear to require co-signers. The patch renames the concept from ‘multisig’ to ‘trailing_references’, removes the unverifiable warning, and renders trailing accounts using the same flag-aware format already used for unknown instructions. For InitializeMultisig, the future members are now shown as trailing accounts rather than a separate ‘Signers’ field, and the at-least-one-member check is no longer enforced on-device. The change is a UI/presentation fix; transaction signing itself was not bypassed, but the user’s decision could be manipulated.
Changed components
core/src/apps/solana/layout.pycore/src/apps/solana/transaction/instruction.pycore/src/apps/solana/transaction/instructions.pycommon/defs/solana/programs.jsoncore/src/apps/solana/predefined_transaction.pyInspect captured patch +197 / −236
### common/defs/solana/programs.json
@@ -8,7 +8,7 @@
{
"id": 0,
"name": "Create Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "lamports",
@@ -59,7 +59,7 @@
{
"id": 1,
"name": "Assign",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "owner",
@@ -87,7 +87,7 @@
{
"id": 2,
"name": "Transfer",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "lamports",
@@ -119,7 +119,7 @@
{
"id": 3,
"name": "Create Account With Seed",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "base",
@@ -181,7 +181,7 @@
{
"id": 4,
"name": "Advance Nonce Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"nonce_account",
@@ -204,7 +204,7 @@
{
"id": 5,
"name": "Withdraw Nonce Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "lamports",
@@ -243,7 +243,7 @@
{
"id": 6,
"name": "Initialize Nonce Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "nonce_authority",
@@ -272,7 +272,7 @@
{
"id": 7,
"name": "Authorize Nonce Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "nonce_authority",
@@ -305,7 +305,7 @@
{
"id": 8,
"name": "Allocate",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "space",
@@ -332,7 +332,7 @@
{
"id": 9,
"name": "Allocate With Seed",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "base",
@@ -378,7 +378,7 @@
{
"id": 10,
"name": "Assign With Seed",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "base",
@@ -415,7 +415,7 @@
{
"id": 11,
"name": "Transfer With Seed",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "lamports",
@@ -457,7 +457,7 @@
{
"id": 12,
"name": "Upgrade Nonce Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"nonce_account"
@@ -480,7 +480,7 @@
{
"id": 0,
"name": "Initialize",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "staker",
@@ -548,7 +548,7 @@
{
"id": 1,
"name": "Authorize",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "pubkey",
@@ -596,7 +596,7 @@
{
"id": 2,
"name": "Delegate Stake",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"initialized_stake_account",
@@ -626,7 +626,7 @@
{
"id": 3,
"name": "Split",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "lamports",
@@ -663,7 +663,7 @@
{
"id": 4,
"name": "Withdraw",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "lamports",
@@ -703,7 +703,7 @@
{
"id": 5,
"name": "Deactivate",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"delegated_stake_account",
@@ -726,7 +726,7 @@
{
"id": 6,
"name": "Set Lockup",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "unix_timestamp",
@@ -779,7 +779,7 @@
{
"id": 7,
"name": "Merge",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"destination_stake_account",
@@ -808,7 +808,7 @@
{
"id": 8,
"name": "Authorize With Seed",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "new_authorized_pubkey",
@@ -866,7 +866,7 @@
{
"id": 9,
"name": "Initialize Checked",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"uninitialized_stake_account",
@@ -894,7 +894,7 @@
{
"id": 10,
"name": "Authorize Checked",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "stake_authorize",
@@ -939,7 +939,7 @@
{
"id": 11,
"name": "Authorize Checked With Seed",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "stake_authorize",
@@ -994,7 +994,7 @@
{
"id": 12,
"name": "Set Lockup Checked",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "unix_timestamp",
@@ -1050,7 +1050,7 @@
{
"id": 1,
"name": "Request Heap Frame",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "bytes",
@@ -1071,7 +1071,7 @@
"id": 2,
"name": "Set Compute Unit Limit",
"is_ui_hidden": true,
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "units",
@@ -1092,7 +1092,7 @@
"id": 3,
"name": "Set Compute Unit Price",
"is_ui_hidden": true,
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "lamports",
@@ -1119,7 +1119,7 @@
{
"id": 1,
"name": "Initialize Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"account_to_initialize",
@@ -1146,7 +1146,7 @@
{
"id": 2,
"name": "Initialize Multisig",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "number_of_signers",
@@ -1156,10 +1156,9 @@
],
"references": [
"multisig_account",
- "rent_sysvar",
- "signer_accounts"
+ "rent_sysvar"
],
- "references_required": 3,
+ "references_required": 2,
"ui_properties": [
{
"account": "multisig_account",
@@ -1168,17 +1167,13 @@
{
"parameter": "number_of_signers",
"display_name": "Threshold"
- },
- {
- "account": "signer_accounts",
- "display_name": "Signers"
}
]
},
{
"id": 3,
"name": "Transfer",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -1216,7 +1211,7 @@
{
"id": 4,
"name": "Approve",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -1254,7 +1249,7 @@
{
"id": 5,
"name": "Revoke",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"source_account",
@@ -1276,7 +1271,7 @@
{
"id": 6,
"name": "Set Authority",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "authority_type",
@@ -1318,7 +1313,7 @@
{
"id": 7,
"name": "Mint To",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -1356,7 +1351,7 @@
{
"id": 8,
"name": "Burn",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -1394,7 +1389,7 @@
{
"id": 9,
"name": "Close Account",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"account_to_close",
@@ -1421,7 +1416,7 @@
{
"id": 10,
"name": "Freeze Account",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"account_to_freeze",
@@ -1448,7 +1443,7 @@
{
"id": 11,
"name": "Thaw Account",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"account_to_freeze",
@@ -1475,7 +1470,7 @@
{
"id": 12,
"name": "Transfer Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -1526,7 +1521,7 @@
{
"id": 13,
"name": "Approve Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -1577,7 +1572,7 @@
{
"id": 14,
"name": "Mint to Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -1623,7 +1618,7 @@
{
"id": 15,
"name": "Burn Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -1669,7 +1664,7 @@
{
"id": 16,
"name": "Initialize Account 2",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "owner",
@@ -1701,7 +1696,7 @@
{
"id": 17,
"name": "Sync Native",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"token_account"
@@ -1717,7 +1712,7 @@
{
"id": 18,
"name": "Initialize Account 3",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "owner",
@@ -1748,7 +1743,7 @@
{
"id": 22,
"name": "Initialize Immutable Owner",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"account_to_initialize"
@@ -1771,7 +1766,7 @@
{
"id": 1,
"name": "Initialize Account",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"account_to_initialize",
@@ -1798,7 +1793,7 @@
{
"id": 2,
"name": "Initialize Multisig",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "number_of_signers",
@@ -1808,10 +1803,9 @@
],
"references": [
"multisig_account",
- "rent_sysvar",
- "signer_accounts"
+ "rent_sysvar"
],
- "references_required": 3,
+ "references_required": 2,
"ui_properties": [
{
"account": "multisig_account",
@@ -1820,17 +1814,13 @@
{
"parameter": "number_of_signers",
"display_name": "Threshold"
- },
- {
- "account": "signer_accounts",
- "display_name": "Signers"
}
]
},
{
"id": 3,
"name": "Transfer",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -1868,7 +1858,7 @@
{
"id": 4,
"name": "Approve",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -1906,7 +1896,7 @@
{
"id": 5,
"name": "Revoke",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"source_account",
@@ -1928,7 +1918,7 @@
{
"id": 6,
"name": "Set Authority",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "authority_type",
@@ -1970,7 +1960,7 @@
{
"id": 7,
"name": "Mint to",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -2008,7 +1998,7 @@
{
"id": 8,
"name": "Burn",
- "is_multisig": true,
+ "trailing_references": true,
"is_deprecated_warning": "Warning: Instruction is deprecated. Token decimals unknown.",
"parameters": [
{
@@ -2046,7 +2036,7 @@
{
"id": 9,
"name": "Close Account",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"account_to_close",
@@ -2073,7 +2063,7 @@
{
"id": 10,
"name": "Freeze Account",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"account_to_freeze",
@@ -2100,7 +2090,7 @@
{
"id": 11,
"name": "Thaw Account",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [],
"references": [
"account_to_freeze",
@@ -2127,7 +2117,7 @@
{
"id": 12,
"name": "Transfer Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -2178,7 +2168,7 @@
{
"id": 13,
"name": "Approve Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -2229,7 +2219,7 @@
{
"id": 14,
"name": "Mint to Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -2275,7 +2265,7 @@
{
"id": 15,
"name": "Burn Checked",
- "is_multisig": true,
+ "trailing_references": true,
"parameters": [
{
"name": "amount",
@@ -2321,7 +2311,7 @@
{
"id": 16,
"name": "Initialize Account 2",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "owner",
@@ -2353,7 +2343,7 @@
{
"id": 17,
"name": "Sync Native",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"token_account"
@@ -2369,7 +2359,7 @@
{
"id": 18,
"name": "Initialize Account 3",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "owner",
@@ -2400,7 +2390,7 @@
{
"id": 22,
"name": "Initialize Immutable Owner",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"account_to_initialize"
@@ -2423,7 +2413,7 @@
{
"id": null,
"name": "Create",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"funding_account",
@@ -2458,7 +2448,7 @@
{
"id": 1,
"name": "Create Idempotent",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"funding_account",
@@ -2492,7 +2482,7 @@
{
"id": 2,
"name": "Recover Nested",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [],
"references": [
"nested_account",
@@ -2531,7 +2521,7 @@
{
"id": null,
"name": "Memo",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "memo",
@@ -2565,7 +2555,7 @@
{
"id": null,
"name": "Memo",
- "is_multisig": false,
+ "trailing_references": false,
"parameters": [
{
"name": "memo",
### common/defs/solana/programs.md
@@ -308,7 +308,6 @@ _This file is generated by `programs.md.mako` via `make solana_templates`, do no
|-------|-------|------|
| Initialize multisig | `multisig_account` | `account` |
| Threshold | `number_of_signers` | `u8` |
-| Signers | `signer_accounts` | `account` |
| _(not shown)_ | `rent_sysvar` | `account` |
### (3) Transfer
@@ -477,7 +476,6 @@ _This file is generated by `programs.md.mako` via `make solana_templates`, do no
|-------|-------|------|
| Init multisig | `multisig_account` | `account` |
| Threshold | `number_of_signers` | `u8` |
-| Signers | `signer_accounts` | `account` |
| _(not shown)_ | `rent_sysvar` | `account` |
### (3) Transfer
### common/tests/fixtures/solana/sign_tx.compute_budget_program.json
@@ -173,7 +173,7 @@
"token_mint": 3,
"destination_account": 2,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -243,7 +243,7 @@
"token_mint": 3,
"destination_account": 2,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
### common/tests/fixtures/solana/sign_tx.payment_request.json
@@ -32,7 +32,7 @@
"token_mint": 0,
"destination_account": 0,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -83,7 +83,7 @@
"token_mint": 0,
"destination_account": 0,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -98,7 +98,7 @@
"token_mint": 0,
"destination_account": 0,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
### common/tests/fixtures/solana/sign_tx.predefined_transactions.json
@@ -32,7 +32,7 @@
"token_mint": 3,
"destination_account": 2,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -86,7 +86,7 @@
"token_mint": 3,
"destination_account": 2,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -162,7 +162,7 @@
"token_mint": 6,
"destination_account": 2,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
### common/tests/fixtures/solana/sign_tx.system_program.json
@@ -205,7 +205,7 @@
"accounts": {
"funding_account": 0,
"recipient_account": 2,
- "multisig_signers": [1]
+ "trailing_accounts": [1]
},
"data": {
"instruction_id": 2,
### common/tests/fixtures/solana/sign_tx.token_program.json
@@ -69,8 +69,7 @@
"accounts": {
"multisig_account": 1,
"rent_sysvar": 3,
- "signer_accounts": 0,
- "multisig_signers": [2]
+ "trailing_accounts": [0, 2]
},
"data": {
"instruction_id": 2,
@@ -186,7 +185,7 @@
"accounts": {
"source_account": 1,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 5
@@ -225,7 +224,7 @@
"accounts": {
"source_account": 2,
"owner": 3,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 5
@@ -262,7 +261,7 @@
"accounts": {
"mint_account": 1,
"current_authority": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 6,
@@ -305,7 +304,7 @@
"accounts": {
"mint_account": 2,
"current_authority": 0,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 6,
@@ -347,7 +346,7 @@
"accounts": {
"mint_account": 1,
"current_authority": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 6,
@@ -468,7 +467,7 @@
"account_to_close": 2,
"destination_account": 1,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 9
@@ -509,7 +508,7 @@
"account_to_close": 3,
"destination_account": 2,
"owner": 4,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 9
@@ -548,7 +547,7 @@
"account_to_freeze": 1,
"token_mint": 2,
"freeze_authority": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 10
@@ -589,7 +588,7 @@
"account_to_freeze": 2,
"token_mint": 3,
"freeze_authority": 4,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 10
@@ -628,7 +627,7 @@
"account_to_freeze": 1,
"token_mint": 2,
"freeze_authority": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 11
@@ -669,7 +668,7 @@
"account_to_freeze": 2,
"token_mint": 3,
"freeze_authority": 4,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 11
@@ -710,7 +709,7 @@
"token_mint": 3,
"destination_account": 1,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -753,7 +752,7 @@
"token_mint": 3,
"destination_account": 1,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 12,
@@ -806,7 +805,7 @@
"token_mint": 5,
"destination_account": 3,
"owner": 6,
- "multisig_signers": [0, 2, 1]
+ "trailing_accounts": [0, 2, 1]
},
"data": {
"instruction_id": 12,
@@ -849,7 +848,7 @@
"token_mint": 2,
"delegate": 3,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 13,
@@ -892,7 +891,7 @@
"token_mint": 2,
"delegate": 3,
"owner": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 13,
@@ -944,7 +943,7 @@
"token_mint": 3,
"delegate": 5,
"owner": 4,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 13,
@@ -985,7 +984,7 @@
"mint": 1,
"account_to_mint": 2,
"minting_authority": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 14,
@@ -1026,7 +1025,7 @@
"mint": 1,
"account_to_mint": 2,
"minting_authority": 0,
- "multisig_signers": []
+ "trailing_accounts": []
},
"data": {
"instruction_id": 14,
@@ -1076,7 +1075,7 @@
"mint": 2,
"account_to_mint": 3,
"minting_authority": 4,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 14,
@@ -1118,7 +1117,7 @@
"account_to_burn_from": 3,
"token_mint": 2,
"owner": 0,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 15,
@@ -1160,7 +1159,7 @@
"account_to_burn_from": 3,
"token_mint": 2,
"owner": 0,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 15,
@@ -1210,7 +1209,7 @@
"account_to_burn_from": 3,
"token_mint": 2,
"owner": 4,
- "multisig_signers": [0, 1]
+ "trailing_accounts": [0, 1]
},
"data": {
"instruction_id": 15,
### core/.changelog.d/+solana_trailing_accounts.security
@@ -0,0 +1 @@
+Solana: Show trailing account references with their actual flags instead of presenting them as multisig signers.
### core/src/apps/solana/README.md
@@ -199,7 +199,7 @@ The `programs.json` file serves as a structured configuration file in the Solana
- `instructions`: An array of instructions associated with the Solana program.
- `id`: A numeric identifier for the instruction derived from the Rust implementation of the corresponding program.
- `name`: The name of the instruction, providing a human-readable label.
- - `is_multisig`: A boolean indicating whether the instruction is a multisig instruction.
+ - `trailing_references`: A boolean indicating whether the instruction accepts additional account references beyond those listed in `references` (e.g. multisig signers for Token program instructions, or the accounts of a newly created multisig).
- `is_deprecated_warning`: Optional, contains a warning message when the instruction is deprecated
- `parameters`: Describes the parameters required for this instruction.
- `name`: The parameter name.
### core/src/apps/solana/layout.py
@@ -28,7 +28,7 @@
from .definitions import Definitions
from .transaction import Fee
from .transaction.instructions import Instruction, SystemProgramTransferInstruction
- from .types import AddressReference
+ from .types import Account, AddressReference
def _format_path(path: list[int]) -> str:
@@ -77,14 +77,6 @@ async def confirm_instruction(
br_code=ButtonRequestType.Other,
)
- if instruction.multisig_signers:
- await confirm_metadata(
- "confirm_multisig",
- TR.solana__confirm_multisig,
- TR.solana__instruction_is_multisig,
- br_code=ButtonRequestType.Other,
- )
-
for ui_property in instruction.ui_properties:
if ui_property.parameter is not None:
property_template = instruction.get_property_template(ui_property.parameter)
@@ -174,31 +166,18 @@ async def confirm_instruction(
else:
raise ValueError # Invalid ui property
- if instruction.multisig_signers:
- signers: list[StrPropertyType] = []
- for i, multisig_signer in enumerate(instruction.multisig_signers, 1):
- if not is_address_reference(multisig_signer):
- multisig_signer_public_key = multisig_signer[0]
- path_str = ""
- if multisig_signer_public_key == signer_public_key:
- path_str = f" ({address_n_to_str(signer_path)})"
- signers.append(
- (
- f"{TR.words__signer} {i}{path_str}",
- base58.encode(multisig_signer_public_key),
- True,
- )
- )
- else:
- signers += _get_address_reference_props(
- multisig_signer, f"{TR.words__signer} {i}"
- )
+ if instruction.trailing_accounts:
+ trailing_account_props: list[StrPropertyType] = []
+ for i, trailing_account in enumerate(instruction.trailing_accounts, 1):
+ trailing_account_props += _get_account_props(
+ trailing_account, i, signer_path, signer_public_key
+ )
await confirm_properties(
br_name="confirm_instruction",
title=instruction_title_index,
subtitle=instruction.ui_name,
- props=signers,
+ props=trailing_account_props,
)
@@ -214,6 +193,34 @@ def get_address_type(address_type: AddressType) -> str:
raise ValueError # Invalid address type
+def _get_account_props(
+ account: Account,
+ account_index: int,
+ signer_path: list[int],
+ signer_public_key: bytes,
+) -> Sequence[StrPropertyType]:
+ if not is_address_reference(account):
+ account_public_key = account[0]
+ address_type = get_address_type(account[1])
+
+ path_str = ""
+ if account_public_key == signer_public_key:
+ path_str = f" ({address_n_to_str(signer_path)})"
+
+ return (
+ (
+ f"{TR.words__account} {account_index}{path_str} {address_type}",
+ base58.encode(account_public_key),
+ True,
+ ),
+ )
+ else:
+ address_type = get_address_type(account[2])
+ return _get_address_reference_props(
+ account, f"{TR.words__account} {account_index} {address_type}"
+ )
+
+
async def confirm_unsupported_instruction_details(
instruction: Instruction,
title: str,
@@ -250,32 +257,14 @@ async def confirm_unsupported_instruction_details(
)
for i, account in enumerate(instruction.accounts, 1):
- accounts: list[StrPropertyType] = []
- if not is_address_reference(account):
- account_public_key = account[0]
- address_type = get_address_type(account[1])
-
- path_str = ""
- if account_public_key == signer_public_key:
- path_str = f" ({address_n_to_str(signer_path)})"
-
- accounts.append(
- (
- f"{TR.words__account} {i}{path_str} {address_type}",
- base58.encode(account_public_key),
- True,
- )
- )
- else:
- address_type = get_address_type(account[2])
- accounts += _get_address_reference_props(
- account, f"{TR.words__account} {i} {address_type}"
- )
-
await confirm_properties(
"accounts",
title,
- list(maybe_with_colon(accounts)),
+ list(
+ maybe_with_colon(
+ _get_account_props(account, i, signer_path, signer_public_key)
+ )
+ ),
)
### core/src/apps/solana/predefined_transaction.py
@@ -239,7 +239,7 @@ async def try_confirm_predefined_transaction(
instructions_count = len(instructions)
for instruction in instructions:
- if instruction.multisig_signers:
+ if instruction.trailing_accounts:
return False
if instructions_count == 1:
### core/src/apps/solana/transaction/instruction.py
@@ -29,7 +29,7 @@ class Instruction:
instruction_data: InstructionData
accounts: list[Account]
- multisig_signers: list[Account]
+ trailing_accounts: list[Account]
is_deprecated_warning: str | None = None
@@ -88,7 +88,7 @@ def __init__(
is_program_supported: bool = True,
is_instruction_supported: bool = True,
is_ui_hidden: bool = False,
- supports_multisig: bool = False,
+ supports_trailing_accounts: bool = False,
is_deprecated_warning: str | None = None,
) -> None:
self.program_id = program_id
@@ -122,13 +122,13 @@ def __init__(
account_templates,
)
- self.multisig_signers = accounts[len(account_templates) :]
- if self.multisig_signers and not supports_multisig:
- raise ValueError # Multisig not supported
+ self.trailing_accounts = accounts[len(account_templates) :]
+ if self.trailing_accounts and not supports_trailing_accounts:
+ raise ValueError # Trailing accounts not supported
else:
self.parsed_data = {}
self.parsed_accounts = {}
- self.multisig_signers = []
+ self.trailing_accounts = []
def __getattr__(self, attr: str) -> Any:
if attr in self.parsed_data:
### core/src/apps/solana/transaction/instructions.py
@@ -564,7 +564,6 @@ class TokenProgramInitializeMultisigInstruction(Instruction):
multisig_account: Account
rent_sysvar: Account
- signer_accounts: Account
class TokenProgramTransferInstruction(Instruction):
amount: int
@@ -684,7 +683,6 @@ class Token2022ProgramInitializeMultisigInstruction(Instruction):
multisig_account: Account
rent_sysvar: Account
- signer_accounts: Account
class Token2022ProgramTransferInstruction(Instruction):
amount: int
@@ -2492,8 +2490,8 @@ def get_instruction(
(),
),
),
- 3,
- ("multisig_account", "rent_sysvar", "signer_accounts"),
+ 2,
+ ("multisig_account", "rent_sysvar"),
(
UIProperty(
None,
@@ -2507,12 +2505,6 @@ def get_instruction(
"Threshold",
None,
),
- UIProperty(
- None,
- "signer_accounts",
- "Signers",
- None,
- ),
),
"Token Program: Initialize Multisig",
True,
@@ -3359,8 +3351,8 @@ def get_instruction(
(),
),
),
- 3,
- ("multisig_account", "rent_sysvar", "signer_accounts"),
+ 2,
+ ("multisig_account", "rent_sysvar"),
(
UIProperty(
None,
@@ -3374,12 +3366,6 @@ def get_instruction(
"Threshold",
None,
),
- UIProperty(
- None,
- "signer_accounts",
- "Signers",
- None,
- ),
),
"Token 2022 Program: Initialize Multisig",
True,
### core/src/apps/solana/transaction/instructions.py.mako
@@ -227,7 +227,7 @@ def get_instruction(
True,
True,
${instruction.get("is_ui_hidden", False)},
- ${instruction["is_multisig"]},
+ ${instruction["trailing_references"]},
${repr(instruction.get("is_deprecated_warning"))},
)
% endfor
### core/tests/test_apps.solana.predefined_transaction.py
@@ -113,7 +113,7 @@ def create_mock_instruction(
is_program_supported=True,
is_instruction_supported=True,
is_ui_hidden=False,
- supports_multisig=False,
+ supports_trailing_accounts=False,
is_deprecated_warning=None,
)
### core/tests/test_apps.solana.predefined_transaction.py.mako
@@ -42,7 +42,7 @@ def create_mock_instruction(
is_program_supported=True,
is_instruction_supported=True,
is_ui_hidden=False,
- supports_multisig=False,
+ supports_trailing_accounts=False,
is_deprecated_warning=None,
)
### tests/device_tests/solana/construct/instructions.py
@@ -92,7 +92,7 @@ class SystemProgramInstruction(Enum):
/ CompactStruct(
"funding_account" / Byte,
"recipient_account" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -626,8 +626,7 @@ class TokenProgramInstruction(Enum):
/ CompactStruct(
"multisig_account" / Byte,
"rent_sysvar" / Byte,
- "signer_accounts" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -643,7 +642,7 @@ class TokenProgramInstruction(Enum):
"source_account" / Byte,
"destination_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -659,7 +658,7 @@ class TokenProgramInstruction(Enum):
"source_account" / Byte,
"delegate_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -674,7 +673,7 @@ class TokenProgramInstruction(Enum):
/ CompactStruct(
"source_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -688,7 +687,7 @@ class TokenProgramInstruction(Enum):
/ CompactStruct(
"mint_account" / Byte,
"current_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -705,7 +704,7 @@ class TokenProgramInstruction(Enum):
"mint" / Byte,
"account_to_mint" / Byte,
"minting_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -721,7 +720,7 @@ class TokenProgramInstruction(Enum):
"account_to_burn_from" / Byte,
"token_mint" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -737,7 +736,7 @@ class TokenProgramInstruction(Enum):
"account_to_close" / Byte,
"destination_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -752,7 +751,7 @@ class TokenProgramInstruction(Enum):
"account_to_freeze" / Byte,
"token_mint" / Byte,
"freeze_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -767,7 +766,7 @@ class TokenProgramInstruction(Enum):
"account_to_freeze" / Byte,
"token_mint" / Byte,
"freeze_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -783,7 +782,7 @@ class TokenProgramInstruction(Enum):
"token_mint" / Byte,
"destination_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -801,7 +800,7 @@ class TokenProgramInstruction(Enum):
"token_mint" / Byte,
"delegate" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -818,7 +817,7 @@ class TokenProgramInstruction(Enum):
"mint" / Byte,
"account_to_mint" / Byte,
"minting_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -835,7 +834,7 @@ class TokenProgramInstruction(Enum):
"account_to_burn_from" / Byte,
"token_mint" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -969,8 +968,7 @@ class Token2022ProgramInstruction(Enum):
/ CompactStruct(
"multisig_account" / Byte,
"rent_sysvar" / Byte,
- "signer_accounts" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -986,7 +984,7 @@ class Token2022ProgramInstruction(Enum):
"source_account" / Byte,
"destination_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1002,7 +1000,7 @@ class Token2022ProgramInstruction(Enum):
"source_account" / Byte,
"delegate_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1017,7 +1015,7 @@ class Token2022ProgramInstruction(Enum):
/ CompactStruct(
"source_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1031,7 +1029,7 @@ class Token2022ProgramInstruction(Enum):
/ CompactStruct(
"mint_account" / Byte,
"current_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1048,7 +1046,7 @@ class Token2022ProgramInstruction(Enum):
"mint" / Byte,
"account_to_mint" / Byte,
"minting_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1064,7 +1062,7 @@ class Token2022ProgramInstruction(Enum):
"account_to_burn_from" / Byte,
"token_mint" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1080,7 +1078,7 @@ class Token2022ProgramInstruction(Enum):
"account_to_close" / Byte,
"destination_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1095,7 +1093,7 @@ class Token2022ProgramInstruction(Enum):
"account_to_freeze" / Byte,
"token_mint" / Byte,
"freeze_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1110,7 +1108,7 @@ class Token2022ProgramInstruction(Enum):
"account_to_freeze" / Byte,
"token_mint" / Byte,
"freeze_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1126,7 +1124,7 @@ class Token2022ProgramInstruction(Enum):
"token_mint" / Byte,
"destination_account" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1144,7 +1142,7 @@ class Token2022ProgramInstruction(Enum):
"token_mint" / Byte,
"delegate" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1161,7 +1159,7 @@ class Token2022ProgramInstruction(Enum):
"mint" / Byte,
"account_to_mint" / Byte,
"minting_authority" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
@@ -1178,7 +1176,7 @@ class Token2022ProgramInstruction(Enum):
"account_to_burn_from" / Byte,
"token_mint" / Byte,
"owner" / Byte,
- "multisig_signers" / Optional(GreedyRange(Byte)),
+ "trailing_accounts" / Optional(GreedyRange(Byte)),
),
"data"
/ CompactStruct(
### tests/device_tests/solana/construct/instructions.py.mako
@@ -89,8 +89,8 @@ ${camelcase(program.name)}_${camelcase(instruction.name)} = Struct(
% for reference in instruction.references[instruction.references_required:]:
"${reference}" / Optional(Byte),
% endfor
- % if instruction.is_multisig:
- "multisig_signers" / Optional(GreedyRange(Byte))
+ % if instruction.trailing_references:
+ "trailing_accounts" / Optional(GreedyRange(Byte))
% endif
),
"data" / CompactStruct(Why this scored 76/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.