fix: add passphrase verification and safety gates to wallet delete - #230
Open
ygd58 wants to merge 1 commit into
Open
fix: add passphrase verification and safety gates to wallet delete#230ygd58 wants to merge 1 commit into
ygd58 wants to merge 1 commit into
Conversation
Closes open-wallet-standard#228 Addresses three safety gaps in ows wallet delete: 1. Passphrase verification (ops.rs) delete_wallet() now requires the owner passphrase before deletion. The passphrase is verified by decrypting the wallet envelope — incorrect passphrase returns an error without touching the file. Agents and scripts cannot delete wallets without owner authentication. 2. API key warning (wallet.rs CLI) Before deletion, the CLI checks for API keys scoped to the wallet and prints a warning listing their names. This makes it clear that dependent keys will stop working after deletion. 3. Path traversal protection (vault.rs) delete_wallet_file() now rejects IDs containing path separators or traversal sequences (../ etc.) with an explicit error instead of relying on file-not-found behaviour. All 604 existing tests pass.
|
@ygd58 is attempting to deploy a commit to the MoonPay Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #228
Summary
Addresses all four safety gaps in
ows wallet deletereported in issue #228.Changes
1. Passphrase verification (
ops.rs)delete_wallet()now requires the owner passphrase before deletion. The passphrase is verified by decrypting the wallet envelope — an incorrect passphrase returns an error without touching the file. Agents and scripts cannot delete wallets without owner authentication.2. API key warning (
wallet.rsCLI)Before deletion, the CLI checks for API keys scoped to the wallet and prints a warning listing their names, so the user knows which keys will stop working after deletion.
3. Path traversal protection (
vault.rs)delete_wallet_file()now explicitly rejects IDs containing path separators or traversal sequences (../etc.) with a clear error.4. Filesystem permissions respected (
vault.rs)If the vault directory has read-only permissions (e.g.
chmod 500),delete_wallet_file()now returns an explicit error instead of silently restoring write permissions to force deletion. Checks the owner-write bit (0o200) on the vault directory before attempting removal.Testing
All 604 existing tests pass.