feat: lock shortcut wiring, handle resolution validation, invoice mismatch errors, and spend limit max amount extraction - #1436
Open
bitcoindev817-hue wants to merge 1 commit into
Conversation
…match errors, and spend limit max amount extraction (fixes ancore-org#1398, ancore-org#1403, ancore-org#1395, ancore-org#1401)
|
@bitcoindev817-hue Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR resolves four critical security, extension, and contract issues on
ancore-org/ancore:[EXTENSION] Wire "Lock shortcut" Security Setting ([EXTENSION] The "Lock shortcut" security setting has zero effect — its only implementation is entirely unmounted, parallel to the real lock/unlock system #1398)
⌘+Shift+L/Ctrl+Shift+L) inExtensionAuthProvider(apps/extension-wallet/src/router/AuthGuard.tsx).useSettingsStore(enableLockShortcut) andlockWallet().useLockManagerhook to use active extension auth context lock when mounted inside the provider.[EXTENSION] Handle Resolution Schema Check & Recipient Address Format Validation ([EXTENSION] @username handle resolution bypasses its own schema check, and the resolved address is never format-validated before becoming the send destination #1395)
apps/extension-wallet/src/services/handle-resolver.tsto ensuresafeParseMUST succeed.resolvedHandleSchemain@ancore/typesto validate bothG...(public key) andC...(contract) Stellar address formats.isStellarAddresscheck inuseSendTransaction.tsfollowing handle resolution prior to setting recipienttoaddress.[CONTRACT] Invoice Contract AssetMismatch & AmountMismatch Validation ([CONTRACT] Invoice contract declares AssetMismatch/AmountMismatch errors that no code path can ever return #1403)
pay_verifiedtoInvoiceContractincontracts/invoice/src/lib.rssupporting optional expected amount and asset parameters.InvoiceError::AmountMismatchwhen caller expected amount does not match invoice amount, andInvoiceError::AssetMismatchwhen asset does not match.test_pay_verified_mismatches.[CONTRACT] Account Spend Limit Maximum Amount Extraction ([CONTRACT] extract_spend_amount picks the first positive i128 argument as "the spend amount" — trivially bypasses per-call and cumulative spend limits #1401)
extract_spend_amountincontracts/account/src/lib.rsto compute the maximum positivei128argument value across all call arguments.1i128) preceding larger amounts (e.g.999_999i128) from masking or bypassing per-call and cumulative spend limit checks.test_execute_session_key_multiple_args_decoy_prevention.Closes #1398
Closes #1403
Closes #1395
Closes #1401