fix(solana): show optional instruction params by default
What changed, and why it matters
This update fixes a security issue in Trezor's Solana transaction signing where important instruction details were hidden from the user. Previously, when a Solana instruction had an optional parameter set to 'None', Trezor simply did not show it at all. But 'None' can sometimes mean something important, like permanently removing an authority, not just 'nothing happens.' After the fix, Trezor now shows 'None' to the user by default, unless the developers explicitly mark that parameter as safe to hide. This helps prevent users from unknowingly approving destructive actions, such as removing their own control over tokens or clearing stake account lockups.
Treat this commit as a security fix. Ensure the firmware release containing it is deployed to users. Review other blockchain apps in the Trezor codebase for similar patterns where None or default values are silently hidden from confirmation screens. Verify that the new 'none' modifier is applied only where None truly means 'no change' and not to destructive None values.
Security signals we found
UI confirmation bypass: optional parameters with None value were silently omitted from user review
Semantic ambiguity of None: treated as absence-of-value when it can encode a destructive action
Irreversible operation hidden: SetAuthority with None new_authority removes authority without user visibility
Real zero values hidden: SetLockup timestamp/epoch of 0 clears lockup but was treated as default/safe
New safe-hide modifier introduced: 'default_value_to_hide': 'none' to explicitly suppress non-action None values
Changelog/security entry present: core/.changelog.d/+solana_optional_params.security
Test fixtures added for both destructive and no-change None semantics
Evidence from the diff
The commit changes the Solana instruction confirmation logic in Trezor firmware. Previously, in core/src/apps/solana/layout.py, optional parameters with value None were silently skipped during UI confirmation. The patch removes that blanket skip and instead renders None as the string ‘None’ to the user. A new special value ‘none’ for default_value_to_hide is introduced so developers can explicitly suppress display of None when it genuinely means ‘no change’ (e.g., SetLockup fields left unchanged). Conversely, numeric default values like 0 are no longer hidden by default for lockup timestamp/epoch because 0 is a real value that clears the lockup. The SetAuthority instruction’s new_authority None now displays as ‘None’ because it represents an irreversible authority removal. programs.json and the generated instructions.py are updated accordingly, and new test fixtures cover clearing lockups with zero values and removing token authority.
Changed components
core/src/apps/solana/layout.pycore/src/apps/solana/transaction/instructions.pycommon/defs/solana/programs.jsoncommon/tests/fixtures/solana/sign_tx.stake_program.jsoncommon/tests/fixtures/solana/sign_tx.token_program.jsoncore/src/apps/solana/README.mdcore/.changelog.d/+solana_optional_params.securityInspect captured patch +169 / −28
### common/defs/solana/programs.json
@@ -757,16 +757,17 @@
{
"parameter": "unix_timestamp",
"display_name": "Time",
- "default_value_to_hide": 0
+ "default_value_to_hide": "none"
},
{
"parameter": "epoch",
"display_name": "Epoch",
- "default_value_to_hide": 0
+ "default_value_to_hide": "none"
},
{
"parameter": "custodian",
- "display_name": "New lockup authority"
+ "display_name": "New lockup authority",
+ "default_value_to_hide": "none"
},
{
"account": "lockup_or_withdraw_authority",
@@ -1020,12 +1021,12 @@
{
"parameter": "unix_timestamp",
"display_name": "Time",
- "default_value_to_hide": 0
+ "default_value_to_hide": "none"
},
{
"parameter": "epoch",
"display_name": "Epoch",
- "default_value_to_hide": 0
+ "default_value_to_hide": "none"
},
{
"account": "new_lockup_authority",
### common/tests/fixtures/solana/sign_tx.stake_program.json
@@ -359,6 +359,53 @@
"expected_signature": "b92c3f408965ceee6512ede6dec12b0436eb62e9631b5f9a4eef33384a745f0d57d583cb808ae41f2cfb24ffa768738724269a3f528be491e64162b016cbce03"
}
},
+ {
+ "description": "Set Lockup - clear lockup with zero values",
+ "parameters": {
+ "address": "m/44'/501'/0'/0'",
+ "construct": {
+ "version": null,
+ "header": {
+ "signers": 1,
+ "readonly_signers": 0,
+ "readonly_non_signers": 1
+ },
+ "accounts": [
+ "14CCvQzQzHCVgZM3j9soPnXuJXh1RmCfwLVUcdfbZVBS",
+ "ATFXMD5cYiw9yHkvexgx3nf9LNSouEViB5BZBsgwunAv",
+ "Stake11111111111111111111111111111111111111"
+ ],
+ "blockhash": "ENP1bFTWGR7GiPcPg7TB9ekX82xaham8aFkB7vQeoNaZ",
+ "instructions": [
+ {
+ "program_index": 2,
+ "accounts": {
+ "initialized_stake_account": 1,
+ "lockup_or_withdraw_authority": 0
+ },
+ "data": {
+ "instruction_id": 6,
+ "unix_timestamp": {
+ "is_included": 1,
+ "value": 0
+ },
+ "epoch": {
+ "is_included": 1,
+ "value": 0
+ },
+ "custodian": {
+ "is_included": 0
+ }
+ }
+ }
+ ],
+ "luts": []
+ }
+ },
+ "result": {
+ "expected_signature": "cdfb4dee4c413b9538196b41bc7d97325e3b7f2042eee9b0d3b1c374512f1af9e0f8f5f5f5453441fee3fdda917aff75399b9a87b2c993912f5c9a2087eb000a"
+ }
+ },
{
"description": "Merge",
"parameters": {
@@ -649,6 +696,50 @@
"expected_signature": "42b06682b7cc946143dece29c7014e408d37768d8dcd28c5293c0b13c35000cbf771886dfd4a2f1cad487621b46167d4b32ecc51c605bef0f450da6761952e05"
}
},
+ {
+ "description": "Set Lockup Checked - clear lockup with zero values",
+ "parameters": {
+ "address": "m/44'/501'/0'/0'",
+ "construct": {
+ "version": null,
+ "header": {
+ "signers": 1,
+ "readonly_signers": 0,
+ "readonly_non_signers": 1
+ },
+ "accounts": [
+ "14CCvQzQzHCVgZM3j9soPnXuJXh1RmCfwLVUcdfbZVBS",
+ "ATFXMD5cYiw9yHkvexgx3nf9LNSouEViB5BZBsgwunAv",
+ "Stake11111111111111111111111111111111111111"
+ ],
+ "blockhash": "2UZYH9e662w7SoLiwnGyGZY1Mn5YjEkWEozZGm5ViR6Q",
+ "instructions": [
+ {
+ "program_index": 2,
+ "accounts": {
+ "stake_account": 1,
+ "lockup_or_withdraw_authority": 0
+ },
+ "data": {
+ "instruction_id": 12,
+ "unix_timestamp": {
+ "is_included": 1,
+ "value": 0
+ },
+ "epoch": {
+ "is_included": 1,
+ "value": 0
+ }
+ }
+ }
+ ],
+ "luts": []
+ }
+ },
+ "result": {
+ "expected_signature": "f243707a5c71ad44c9dd13530403a1ed5d9936dafe0b95c6e368dbd2023feebd47447a510c0453afe4eb35ee5dcebe62454730b11b63d2f8b1500a2fec717202"
+ }
+ },
{
"description": "Create Stake Account",
"parameters": {
### common/tests/fixtures/solana/sign_tx.token_program.json
@@ -324,6 +324,47 @@
"expected_signature": "a12a94f3eb362c680f343713789425f9809c54cf4cb5f5fbfd5330cf9e60731cb45c489fe42a07a2bfd0bff1ec64b6ca3389c94aaee1b618893cc9666dc74c0c"
}
},
+ {
+ "description": "Set Authority - remove authority",
+ "parameters": {
+ "address": "m/44'/501'/0'/0'",
+ "construct": {
+ "version": null,
+ "header": {
+ "signers": 1,
+ "readonly_signers": 0,
+ "readonly_non_signers": 1
+ },
+ "accounts": [
+ "14CCvQzQzHCVgZM3j9soPnXuJXh1RmCfwLVUcdfbZVBS",
+ "FUqrjRRtF1LiptdFqaFxipE8R3YfCE4k56xwm5n1piqX",
+ "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
+ ],
+ "blockhash": "2p4rYZAaFfV5Uk5ugdG5KPNty9Uda9B3b4gWB8qnNqak",
+ "instructions": [
+ {
+ "program_index": 2,
+ "accounts": {
+ "mint_account": 1,
+ "current_authority": 0,
+ "multisig_signers": []
+ },
+ "data": {
+ "instruction_id": 6,
+ "authority_type": 0,
+ "new_authority": {
+ "is_included": 0
+ }
+ }
+ }
+ ],
+ "luts": []
+ }
+ },
+ "result": {
+ "expected_signature": "29af6a6a960b6e6a7cd67a07310c2f19267f4135750ac6575aab6e9e7df6dc43417883db032b0a67381c5f5495e47770c36095065755f9f9e0197bbb75124c0a"
+ }
+ },
{
"description": "Mint To",
"parameters": {
### core/.changelog.d/+solana_optional_params.security
@@ -0,0 +1 @@
+Solana: Ask user for confirmation of optional instruction parameters that were previously hidden, e.g. when unsetting a token authority.
### core/src/apps/solana/README.md
@@ -212,7 +212,7 @@ The `programs.json` file serves as a structured configuration file in the Solana
- `account`: Reference to one account in the references list identified by its `name`
- `parameter`: Reference to one parameter in the parameters list identified by its `name`
- `display_name`: A human-readable label for the parameter or account, suitable for user interfaces.
- - `default_value_to_hide`: Optional. If this value is found in the account / parameter, the UI property will not be shown for confirmation. This is useful when the default value is considered safe. In particular, if the value of the property is a public key, and the special word `"signer"` is used for `default_value_to_hide`, the UI property will be hidden if the public key matches the Trezor's account.
+ - `default_value_to_hide`: Optional. If this value is found in the account / parameter, the UI property will not be shown for confirmation. This is useful when the default value is considered safe. Two special words are recognized: if `"signer"` is used and the value of the property is a public key, the UI property will be hidden if the public key matches the Trezor's account; if `"none"` is used, the UI property will be hidden if its value is `None` (an absent optional parameter, which is otherwise displayed as `None`). An absent optional account reference is always hidden, regardless of `default_value_to_hide`.
Certain types of parameters, specified in `types` dict of the `programs.json` file, have special formatting capabilities.
In particular, the type `token_amount` is a regular `u64` type, but the formatter function accepts additional parameters:
### core/src/apps/solana/layout.py
@@ -90,26 +90,33 @@ async def confirm_instruction(
property_template = instruction.get_property_template(ui_property.parameter)
value = instruction.parsed_data[ui_property.parameter]
- if property_template.optional and value is None:
- continue
-
default_value_to_hide = ui_property.default_value_to_hide
- if default_value_to_hide == "signer":
+ if default_value_to_hide == "none":
+ if value is None:
+ continue
+ elif default_value_to_hide == "signer":
if property_template.is_pubkey() and signer_public_key == value:
continue
- elif default_value_to_hide == value:
- continue
+ elif default_value_to_hide is not None:
+ if default_value_to_hide == value:
+ continue
- args = []
- for arg in property_template.args:
- if arg == "#definitions":
- args.append(definitions)
- elif arg in instruction.parsed_data:
- args.append(instruction.parsed_data[arg])
- elif arg in instruction.parsed_accounts:
- args.append(instruction.parsed_accounts[arg][0])
- else:
- raise ValueError # Invalid property template
+ if value is None:
+ # only optional parameters can be None
+ formatted_value = "None"
+ else:
+ args = []
+ for arg in property_template.args:
+ if arg == "#definitions":
+ args.append(definitions)
+ elif arg in instruction.parsed_data:
+ args.append(instruction.parsed_data[arg])
+ elif arg in instruction.parsed_accounts:
+ args.append(instruction.parsed_accounts[arg][0])
+ else:
+ raise ValueError # Invalid property template
+
+ formatted_value = property_template.format(value, *args)
await confirm_properties(
br_name="confirm_instruction",
@@ -118,7 +125,7 @@ async def confirm_instruction(
props=(
(
ui_property.display_name,
- property_template.format(value, *args),
+ formatted_value,
True,
),
),
### core/src/apps/solana/transaction/instructions.py
@@ -1915,19 +1915,19 @@ def get_instruction(
"unix_timestamp",
None,
"Time",
- 0,
+ "none",
),
UIProperty(
"epoch",
None,
"Epoch",
- 0,
+ "none",
),
UIProperty(
"custodian",
None,
"New lockup authority",
- None,
+ "none",
),
UIProperty(
None,
@@ -2285,13 +2285,13 @@ def get_instruction(
"unix_timestamp",
None,
"Time",
- 0,
+ "none",
),
UIProperty(
"epoch",
None,
"Epoch",
- 0,
+ "none",
),
UIProperty(
None,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.