sign_utils: reject duplicate asset summaries
What changed, and why it matters
This update fixes a flaw in the Blockstream Jade hardware wallet's transaction signing code. Before the fix, a transaction could include the same asset summary twice. The duplicate would not be fully security-checked, but could still be shown to the user on the device screen, potentially misleading them into approving a bad transaction. The fix now rejects any transaction that lists the same asset summary more than once.
Treat as a security hardening fix with user-facing impact. Users should upgrade firmware to a version containing this commit. Developers should review whether other summary/field arrays (inputs, outputs, asset metadata) have similar duplicate-acceptance issues and add analogous uniqueness checks.
Security signals we found
UI spoofing / user-misleading vector: duplicate unvalidated summary could be displayed
Validation bypass: duplicate asset summary skipped full validation
Transaction signing hardening
No explicit CVE or advisory referenced in commit
Evidence from the diff
In main/process/sign_utils.c, a new helper asset_summary_ids_unique() checks that no asset_id appears more than once within the input or output asset_summary arrays. validate_additional_info() now calls this helper and fails with ‘Duplicate asset in asset summary’ if duplicates are found. The commit message explicitly states the reason: ‘A duplicate would never be validated but would still appear in the summary shown to the user.’ This closes a validation bypass / user-interface spoofing path during transaction signing.
Changed components
main/process/sign_utils.cTransaction signing flowAsset summary validationInspect captured patch +20 / −0
### main/process/sign_utils.c
@@ -173,6 +173,20 @@ static bool rpc_get_asset_summary(jade_process_t* process, const char* field, co
return true;
}
+// A duplicate would never be validated but would still appear in the summary shown to the user
+static bool asset_summary_ids_unique(const asset_summary_t* sums, const size_t num_sums)
+{
+ for (size_t i = 0; i < num_sums; ++i) {
+ for (size_t j = i + 1; j < num_sums; ++j) {
+ if (!memcmp(sums[i].asset_id, sums[j].asset_id, sizeof(sums[i].asset_id))) {
+ JADE_LOGW("Duplicate asset-id in asset summary");
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
static bool validate_additional_info(const struct wally_tx* tx, const TxType_t txtype, const bool is_partial,
const asset_summary_t* in_sums, const size_t num_in_sums, const asset_summary_t* out_sums,
const size_t num_out_sums, const char** errmsg)
@@ -182,6 +196,12 @@ static bool validate_additional_info(const struct wally_tx* tx, const TxType_t t
JADE_ASSERT(!out_sums == !num_out_sums);
JADE_INIT_OUT_PPTR(errmsg);
+ // Each summary must list each asset-id at most once
+ if (!asset_summary_ids_unique(in_sums, num_in_sums) || !asset_summary_ids_unique(out_sums, num_out_sums)) {
+ *errmsg = "Duplicate asset in asset summary";
+ return false;
+ }
+
// Validate tx type data
if (txtype == TXTYPE_SWAP) {
// Input and output summary must be present - they will be fully validated laterWhy this scored 64/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.