Skip to content

Commit f856296

Browse files
cerberus-production[bot]Cerberus Merlin
andauthored
fix: Standard swap flow can auto-sign unvalidated calldata when blind signing is enabled (#1036)
Co-authored-by: Cerberus Merlin <merlin@cerberus.security>
1 parent ee35bb3 commit f856296

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/features/sign_tx/logic_sign_tx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,14 @@ uint16_t finalize_parsing(const txContext_t *context) {
576576
// unreachable
577577
os_sched_exit(0);
578578
}
579+
if (tmpContent.txContent.dataPresent && (G_swap_mode == SWAP_MODE_STANDARD)) {
580+
PRINTF("Unvalidated calldata is not allowed in standard swap\n");
581+
send_swap_error_simple(APDU_RESPONSE_MODE_CHECK_FAILED,
582+
SWAP_EC_ERROR_WRONG_METHOD,
583+
APP_CODE_DEFAULT);
584+
// unreachable
585+
os_sched_exit(0);
586+
}
579587
io_seproxyhal_touch_tx_ok();
580588
sw = SWO_SUCCESS;
581589
} else {

0 commit comments

Comments
 (0)