Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Improve error message when making a ledger key with index > 100 #19687

Closed
1 task done
ValarDragon opened this issue Mar 7, 2024 · 1 comment · Fixed by #22116
Closed
1 task done

[Bug]: Improve error message when making a ledger key with index > 100 #19687

ValarDragon opened this issue Mar 7, 2024 · 1 comment · Fixed by #22116
Labels
C:Ledger Issues and features related Ledger integration and functionality good first issue T:Bug

Comments

@ValarDragon
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Got roughly this error reported from users, and I can replicate. If you have expert mode off on the cosmos ledger app, you can't create keys with index > 100.

osmosisd keys add --ledger --index="102" test_102
Error: failed to generate ledger key: failed to recover pubkey: [APDU_CODE_CONDITIONS_NOT_SATISFIED] Conditions of use not satisfied: address rejected for path m/44'/118'/0'/0/102

We should make a more friendly error message in such cases, informing the user to enable expert mode.

Cosmos SDK Version

0.47

How to reproduce?

Connect a ledger. Open cosmos app, ensure expert mode is off. Run:

$DAEMON keys add --ledger --index="102" test_102

You will see:

Error: failed to generate ledger key: failed to recover pubkey: [APDU_CODE_CONDITIONS_NOT_SATISFIED] Conditions of use not satisfied: address rejected for path m/44'/118'/0'/0/102

Enable expert mode, it will work.

@ftheirs
Copy link

ftheirs commented Mar 7, 2024

Normally, scanning balances occurs sequentially: 0, 1, 2, ... N. Please note that this process can be time-consuming. As part of a security measure, Expert mode is required to retrieve an {address, pubkey} with a large index (greater than 100). If a compromised wallet uses a high index and you are unaware of it, you (temporarily) might lose access to funds sent there.

@tac0turtle tac0turtle added the C:Ledger Issues and features related Ledger integration and functionality label Mar 7, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 🥳 Done in Cosmos-SDK Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Ledger Issues and features related Ledger integration and functionality good first issue T:Bug
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

4 participants