fix(cardano): ask detail level for script data hash
What changed, and why it matters
This update fixes a display issue in Trezor's Cardano signing flow. When a user signs a simple-looking Cardano transaction that secretly includes a 'script data hash,' the device now asks the user to confirm details instead of hiding that hash. The script data hash is still signed, but previously it could be shown without the user being prompted at the right detail level, which could make it easier for a malicious app or website to trick the user into approving something they did not fully understand.
Users should install firmware containing this fix. Developers should review whether other advanced Cardano transaction fields (reference inputs, collateral return, total collateral, etc.) are similarly omitted from the suite-type check and ensure every signed field has an appropriate user confirmation path.
Security signals we found
Missing user confirmation for signed transaction field
UI flow downgrade for advanced transaction feature
Signed-but-hidden transaction data
Changelog explicitly labeled as security fix
Evidence from the diff
In the Cardano ordinary signer, the _suite_tx_type method decides whether a transaction is treated as a simple ‘suite’ transaction or as a more advanced transaction that requires the user to choose a level of details. The script_data_hash field was not included in the check that bumps the transaction to NOT_SUITE_TX. As a result, a transaction containing a script_data_hash could still be rendered as a simple transaction, skipping the details prompt, even though the script data hash is part of the signed transaction body. The patch adds ‘or msg.script_data_hash is not None’ to the condition and adds a test fixture for an ordinary transaction with a script data hash.
Changed components
core/src/apps/cardano/sign_tx/ordinary_signer.pyCardano transaction signing UI flowTrezor Model T / Safe firmware Cardano appInspect captured patch +50 / −0
### common/tests/fixtures/cardano/sign_tx.show_details.json
@@ -491,6 +491,54 @@
}
]
}
+ },
+ {
+ "description": "Ordinary transaction with script data hash",
+ "parameters": {
+ "protocol_magic": 764824073,
+ "network_id": 1,
+ "fee": 42,
+ "ttl": 10,
+ "validity_interval_start": null,
+ "certificates": [],
+ "withdrawals": [],
+ "auxiliary_data": null,
+ "inputs": [
+ {
+ "path": "m/1852'/1815'/0'/0/0",
+ "prev_hash": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7",
+ "prev_index": 0
+ }
+ ],
+ "outputs": [
+ {
+ "address": "addr1q84sh2j72ux0l03fxndjnhctdg7hcppsaejafsa84vh7lwgmcs5wgus8qt4atk45lvt4xfxpjtwfhdmvchdf2m3u3hlsd5tq5r",
+ "amount": "1"
+ }
+ ],
+ "mint": [],
+ "script_data_hash": "d593fd793c377ac50a3169bb8378ffc257c944da31aa8f355dfa5a4f6ff89e02",
+ "collateral_inputs": [],
+ "required_signers": [],
+ "collateral_return": null,
+ "total_collateral": null,
+ "reference_inputs": [],
+ "signing_mode": "ORDINARY_TRANSACTION",
+ "additional_witness_requests": [],
+ "include_network_id": false,
+ "tag_cbor_sets": false
+ },
+ "result": {
+ "tx_hash": "8606e5b69b5c40bd359d7bad6ed6f77810b8e8acba6cbca298c13f92b11178d4",
+ "witnesses": [
+ {
+ "type": 1,
+ "pub_key": "5d010cf16fdeff40955633d6c565f3844a288a24967cf6b76acbeb271b4f13c1",
+ "signature": "c8676cf593554f347e2d6a5ffc6a1371638156eaaddb3e7f94ae9a7488a6adb01c3660d8aff1da08e01c4899615158e69c5c797841ef7747740ab56d3b452f0c",
+ "chain_code": null
+ }
+ ]
+ }
}
]
}
### core/.changelog.d/+cardano-script-data-hash.security
@@ -0,0 +1 @@
+Cardano: Ask for the level of details when a simple transaction contains a script data hash.
### core/src/apps/cardano/sign_tx/ordinary_signer.py
@@ -51,6 +51,7 @@ def _suite_tx_type(self) -> SuiteTxType:
msg.minting_asset_groups_count > 0
or msg.required_signers_count > 0
or msg.has_auxiliary_data
+ or msg.script_data_hash is not None
):
# transaction has more advanced features
return SuiteTxType.NOT_SUITE_TXWhy this scored 60/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.