Skip to content

App Checks Improvements - #83

Open
chcmedeiros wants to merge 13 commits into
LedgerHQ:developfrom
cosmos:main
Open

App Checks Improvements#83
chcmedeiros wants to merge 13 commits into
LedgerHQ:developfrom
cosmos:main

Conversation

@chcmedeiros

Copy link
Copy Markdown

A few small improvements and maintenance updates to the Cosmos app:

  • Swap validation: require a single coin per amount / fee / coins field in the swap-signing checks, matching how swap flows always transfer a single coin. Multi-coin arrays are rejected with a clear error.
  • Signing robustness: when a sign request omits the HRP on the default Cosmos path, use the default cosmos HRP explicitly so the flow is self-contained instead of depending on prior request state. Includes a zemu regression test.
  • bump ledger-zxlib to v50.0.0.
  • bump the app patch version to 2.38.20 and refresh the main-menu snapshots.

chcmedeiros and others added 10 commits June 25, 2026 10:42
* Restrict amino SignDoc to a known field allowlist

Validate that the SignDoc root and the StdFee object only contain keys
from a known set, so every signed field is one the device can display.
Drop the now-unused fee/gas_limit display mapping and add tx_validate
tests covering the new behaviour.

* chore(version): Bump application patch version to 19

* update snapshots

* bump zxlib

* fix(amino): resolve allowlist key pointers through PIC()

validate_allowed_keys dereferenced the static allowed-key string
pointers directly, which are link-time addresses on a relocated app
and caused a SIGSEGV on every amino SignDoc. Wrap them in PIC().
Swap flows always transfer a single coin, and the Exchange app approves a single amount and fee. Make the swap validation checks enforce this explicitly: each amount, fee and coins item in a swap-validated message must be exactly one coin (a single display page) for the value comparison to cover it fully.

Add a parser_swap_multiple_coins result for the multi-coin case. Single-coin transactions - the only form swap flows produce - are unaffected, so existing swap flows and functional tests keep working.
On the default Cosmos path a SIGN request may omit the HRP for backward compatibility. The address derivation then reused whatever HRP remained in the global buffer from an earlier request, so the result depended on prior state.

Set the default "cosmos" HRP explicitly for this case so omitted-HRP signing on path 118 is self-contained and deterministic. Requests that provide an HRP, and the get-address flow, are unchanged.

Add a zemu regression test: a rejected mixed-case GET_ADDR followed by an omitted-HRP SIGN now reaches review and produces a valid signature.
Refresh the main-menu zemu snapshots for the new version string (v2.38.20).
App improvements: swap validation, signing robustness, and dependency bump
Bumps app patch version to 21
@tdejoigny-ledger

Copy link
Copy Markdown

@chcmedeiros guideline enforcer CI has not run

chcmedeiros and others added 3 commits July 15, 2026 17:55
…hers

Derive the msgs flatten depth per message from each message's own type
instead of one global flag for the whole array. Previously extraDepthLevel
was set once based on whether any "Multi" type appeared, so a transaction
mixing a MsgMultiSend with a MsgSend counted and rendered a different set of
fields and some Send fields were dropped from the review screens.

tx_traverse_find now sets query.max_level per element via tx_msg_max_level()
(MsgMultiSend -> 3, all other messages -> 2) and restores it after each
element, keeping item counting consistent with item rendering.

Add a MsgMultiSendAndSend amino test with snapshots for all devices and a
manual.json test case.
Refresh the *-mainmenu snapshots for the new version string.
fix(amino): render every message when MsgMultiSend is batched with others
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants