Skip to content
Back to skills

Sec Wallet Dapp

ASecurity

Security knowledge pack for wallets / DApp frontends / Web3 backends. Load when the project depends on wagmi, viem, ethers, web3.js, @solana/web3.js, @solana/wallet-adapter, @stellar/stellar-sdk, stellar-wallets-kit, freighter, @mysten/dapp-kit, @aptos-labs/wallet-adapter, @tonconnect, WalletConnect, bip39, hdkey, or when code handles mnemonics/private keys, signing and approvals, SIWE login, relayers/paymasters, deposit crediting and withdrawals, or account abstraction.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
securityrustgonodeawsgitapidatabasefrontendbackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 16 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add 57blocks/security-plugin --skill sec-wallet-dapp --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sec Wallet Dapp?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sec Wallet Dapp
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/57blocks-sec-wallet-dapp-security-plugin/badge)](https://www.skillsdirectory.com/skills/57blocks-sec-wallet-dapp-security-plugin)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "sec-wallet-dapp"
description: "Security knowledge pack for wallets / DApp frontends / Web3 backends. Load when the project depends on wagmi, viem, ethers, web3.js, @solana/web3.js, @solana/wallet-adapter, @stellar/stellar-sdk, stellar-wallets-kit, freighter, @mysten/dapp-kit, @aptos-labs/wallet-adapter, @tonconnect, WalletConnect, bip39, hdkey, or when code handles mnemonics/private keys, signing and approvals, SIWE login, relayers/paymasters, deposit crediting and withdrawals, or account abstraction."
---

# sec-wallet-dapp: wallets, signing, DApp frontends and Web3 backends

## Scope
Coding and auditing of wallet apps (browser extensions, mobile, web/embedded wallets), wallet-connected DApp frontends, signing and login flows, and Web3 backends such as relayers / indexers / deposits and withdrawals / key custody. Contract issues themselves are covered by `sec-web3-*`.

## Read first
- Severity definitions: [severity.md](../sec-core/severity.md). Private key/mnemonic leak or directly draining user funds = P0; **private key/funds issues are at least P1**.
- General Web issues are not repeated here; reference them directly: XSS [WEB-29/30](../sec-web/SKILL.md), `postMessage` [WEB-32](../sec-web/SKILL.md), secrets in the frontend bundle [WEB-33](../sec-web/SKILL.md), hardcoded secrets WEB-42, callback signature verification WEB-50, race conditions WEB-49, idempotency WEB-51, dependency supply chain WEB-55, PII in logs WEB-56.
- Contract-side signing rules (nonce, domain separation, parameter binding, expiry): [sec-web3-common](../sec-web3-common/SKILL.md) W3-28–32; deployment keys W3-48; prices W3-11/12; confused deputy W3-06. EVM details: `sec-web3-evm` EVM-20 (permit), EVM-21/22 (ecrecover), EVM-25 (ERC-1271). Soroban custom accounts: `sec-web3-soroban` SOR-06/07.
- What to verify for each signing standard: [refs/signing-standards.md](refs/signing-standards.md); historical incidents and lessons: [refs/incidents.md](refs/incidents.md).
- For native mobile storage/jailbreak/certificate pinning details, also load `sec-mobile` (if present).

## Hard defaults when writing code (AI-generated code must follow these)
1. Private keys/mnemonics **never** go into: `localStorage`/`sessionStorage`/plain files/plaintext database/logs/analytics/error reporting/URLs/frontend env vars/git.
2. Use only CSPRNG for randomness (`crypto.getRandomValues`, `crypto.randomBytes`, the library's own `generateMnemonic`), never `Math.random`, timestamps or user-passphrase derivation.
3. Before signing, show the user the **decoded** content: chain, contract, function, amount, recipient/spender, expiry; never request a signature over a raw hash.
4. Login signatures (SIWE / SIWS / SEP-10 / ton_proof) always: server-generated single-use nonce + verify domain + verify time + verify the recovered address matches the claimed address.
5. Hardcode contract addresses, token lists and chain config per `chainId` in code; re-read the current chain and account and compare them before sending a transaction.
6. Backend crediting accepts only: allowlisted contract/asset + successful transaction + required confirmation depth + re-check against your own node; withdrawals go through limits, allowlist, review and idempotency.
7. Approvals default to the amount needed, not `MaxUint256`; relayers/paymasters sponsor only allowlisted targets and functions.

---

## Checklist

The 84 items live in `refs/items-*.md`, so a task reads only the part it needs. This index gives each item's ID, title and default level. Items are numbered in the order they were added, so related items can sit in different number ranges; use the file names below.

- Writing or changing code, or `sec-check`: read the files covering what the change touches.
- Full audit: sec-audit assigns item IDs to each perspective (see "Audit perspectives"); read only those items.
- Looking up one item: open the file named here and read from its `### WAL-NN` heading to the next `###` heading.

**[refs/items-keys.md](refs/items-keys.md)**
- WAL-01 Insufficient entropy when generating mnemonics/private keys · default P0
- WAL-02 Private key/mnemonic stored in plaintext in browser or ordinary client storage · default P0
- WAL-03 Mobile/desktop not using system secure storage, or weak local encryption · default P1
- WAL-04 Backend hot-wallet private key not in KMS/HSM/MPC · default P0
- WAL-05 Private key resident in memory long-term and serializable · default P2 (P1 when shares of a split key that are meant to live apart sit together in one client)
- WAL-06 Logs / analytics / crash reporting leak keys · default P0
- WAL-07 Clipboard: copying mnemonics and pasting addresses · default P2
- WAL-08 Screenshots, screen recording, background snapshots and keyboard caching · default P2
- WAL-09 Insecure backup / export flow · default P1
- WAL-10 Hot wallet with no limits and no hot/cold separation · default P1
- WAL-11 No key rotation or leak response · default P2
- WAL-12 Test private keys or default mnemonics committed or used on mainnet · default P0 (when funds or production use are involved)
- WAL-13 Private key/signing key in frontend environment variables · default P0
- WAL-14 Message boundary of extension / embedded wallets · default P0

**[refs/items-wallet-client.md](refs/items-wallet-client.md)**
- WAL-56 Release channel and build pipeline integrity · default P1 (P0 when publish credentials are reachable from untrusted refs such as forks or `pull_request_target`)
- WAL-57 In-app dApp browser / WebView bridge not bound to the page origin · default P0 (P1 when the bridge exposes only read-only methods)
- WAL-58 Deep links and URI handlers (`wc:`, `ethereum:`, `solana:`, `ton://`, universal links) · default P1 (P0 when a link alone opens an arbitrary page in the trusted dApp browser or reaches a signing or export screen pre-approved)
- WAL-59 Injected-provider discovery and hijack (EIP-6963 / `window.ethereum`) · default P1 (P0 when page-controlled state turns off wallet protections or prompts)
- WAL-60 Extension vault and UI hardening (cached secrets, framed popup, MV3 session state) · default P1 (P0 when decrypted keys or the mnemonic are readable by content scripts or a web page, or persist to disk in plaintext)
- WAL-61 Attacker-controlled token, NFT, chain and asset metadata accepted by the wallet · default P1 (P0 when metadata executes script in the wallet context; P2 when it only affects non-signing display)
- WAL-62 Hardware-wallet integration in software wallets and dApps · default P2 (P1 when receive addresses are never verified on the device or a flow requires blind signing)

**[refs/items-crypto-libs.md](refs/items-crypto-libs.md)**
- WAL-63 Embedded / social-login wallet key-share services · default P1 (P0 when a share is released without a valid credential of the victim: unchecked OAuth `aud`/redirect, or iframe export accepted from any origin)
- WAL-64 MPC/TSS protocol implementation flaws (missing proofs, unchecked commitments, outdated libraries) · default P1 (P0 when one party or an observer can extract the full key, e.g. missing Paillier modulus or factor proofs)
- WAL-65 Reusable secret-nonce material (presignatures, triples, nonces) · default P1 (P0 when a normal call path reuses it automatically)
- WAL-66 Multi-party abort semantics: one party commits while others abort · default P2 (P1 when the split outcome can destroy the key or leave funds unspendable)
- WAL-67 Signing primitives: vulnerable library versions, primitive misuse and secret-dependent timing · default P1 (P0 when a version with a key-extraction advisory is reachable from signing; P2 when the only issue is a timing leak)
- WAL-68 Passkey / WebAuthn wallet verification · default P0
- WAL-69 HD derivation misuse · default P1 (P0 when a parent private key is recoverable or keys collide across users)
- WAL-83 DKG / key-refresh dealer contributions not fully validated · default P0 (P1 when a bad contribution can only raise the threshold, stall the run or misattribute a peer, without giving any party control of the key)

**[refs/items-signing.md](refs/items-signing.md)**
- WAL-15 Blind signing: signed content not decoded and displayed · default P1
- WAL-16 EIP-712 domain not displayed or inconsistent with current chain/contract · default P1
- WAL-17 `eth_sign` / `personal_sign` over a raw hash · default P1
- WAL-18 Permit / Permit2 / setApprovalForAll phishing display · default P1
- WAL-19 Unlimited approval by default · default P2
- WAL-20 Incomplete SIWE (EIP-4361) login verification · default P0
- WAL-21 Solana: signMessage / signIn verification and transaction simulation · default P0 (login) / P1 (transactions)
- WAL-22 Stellar: SEP-10 / SEP-45 / SEP-53 and network passphrase · default P0
- WAL-23 Incomplete TON Connect `ton_proof` verification · default P0
- WAL-24 Cross-chain / cross-network signature replay · default P1
- WAL-25 Backend signature-verification pitfalls (ecrecover class) · default P0
- WAL-26 No support for contract wallet signatures (ERC-1271 / EIP-6492) · default P2 (P0 when falling back to ECDSA wrongly lets requests through)
- WAL-27 Request origin display and WalletConnect verification · default P1
- WAL-78 Batch calls shown incompletely (EIP-5792 `wallet_sendCalls`, 7702 and 4337 batches) · default P1 (P0 when the wallet shows only the first call or only a net summary)
- WAL-79 Clear-signing metadata trusted without binding (ERC-7730 descriptors, selector databases, token labels) · default P1
- WAL-80 Simulation result trusted as the final outcome (evasion, check-then-use) · default P1

**[refs/items-non-evm-signing.md](refs/items-non-evm-signing.md)**
- WAL-70 Solana: account, token and delegate authority changes not decoded or flagged · default P1 (P0 when the wallet signs with no instruction-level display, or a backend signs client-supplied instructions)
- WAL-71 Solana: durable-nonce transactions and delayed submission · default P1
- WAL-72 Solana: backend co-signs client-built transactions as fee payer or authority · default P0
- WAL-73 Bitcoin PSBT signing: inputs, sighash, amounts and change not checked · default P1 (P0 when the wallet signs every own input by default for a dApp)
- WAL-74 Solana Actions / Blinks: transaction from an untrusted action endpoint · default P1
- WAL-75 Telegram Mini App: `initData` trusted without server-side validation · default P1 (P0 when `initData` is the login or links a wallet to a Telegram account)
- WAL-76 TON Connect: `sendTransaction`, `signMessage` and `signData` requests not validated · default P1
- WAL-77 Sui / Aptos wallet-standard: self-reported signing output and sign-only results · default P1 (P0 for login)

**[refs/items-agent-payments.md](refs/items-agent-payments.md)**
- WAL-81 x402 resource server or facilitator accepts a payment not bound to the request · default P1 (P0 when one payment can be replayed without limit or content is served with no settlement, so every paid route is free to anyone)
- WAL-82 Agent wallet spends on server-declared prices with no external policy · default P1 (P0 when the agent key can move the whole balance or the policy lives in agent-editable config)

**[refs/items-dapp-frontend.md](refs/items-dapp-frontend.md)**
- WAL-28 Trusting cached wallet account and chain state · default P1
- WAL-29 Missing network switching and per-chain address mapping · default P1
- WAL-30 Transaction parameters decided only by the frontend and tamperable · default P1
- WAL-31 No simulation and no asset-change display before sending · default P2
- WAL-32 Contract addresses / token lists / routing config from untrusted sources · default P0
- WAL-33 Security decisions based on a single trusted RPC · default P2 (P0 when backend crediting depends on it, see WAL-45/47)
- WAL-34 RPC / indexing API keys exposed in the frontend · default P2 (P1 when an exposed bundler or paymaster key can spend the sponsorship balance or uncapped paid usage)
- WAL-35 Frontend dependency supply chain (poisoned wallet libraries) · default P1 (P0 when a known malicious version is in the lockfile)
- WAL-36 Third-party scripts, missing CSP and SRI · default P1
- WAL-37 Domain / DNS / hosting account hijacking · default P1
- WAL-38 Clickjacking · default P2
- WAL-39 XSS in a DApp equals wallet theft · default P0
- WAL-40 Address display, address poisoning and ENS/homoglyph spoofing · default P1
- WAL-41 IPFS / ENS-hosted frontends · default P2

**[refs/items-backend.md](refs/items-backend.md)**
- WAL-42 Relayer signs arbitrary transactions on behalf of users · default P0
- WAL-43 Gas sponsorship / paymaster policy abuse · default P1
- WAL-44 Sender nonce management races and duplicate payouts · default P0 (duplicate withdrawals) / P2 (stuck transactions only)
- WAL-45 Crediting before confirmation depth, no reorg handling · default P0
- WAL-46 Wrong attribution of deposit address / memo / tag · default P0
- WAL-47 Crediting from events without verifying the event source (fake tokens) · default P0
- WAL-48 Withdrawal flow lacks risk controls · default P0
- WAL-49 On-chain event webhooks not verified or used directly for crediting · default P0
- WAL-50 Backend uses manipulable or stale prices · default P1
- WAL-51 Signing service / custody API lacks authorization and policy · default P0
- WAL-84 Custody / multisig change requests show the result, not the diff; registry entries renamable · default P1

**[refs/items-aa-smart-wallets.md](refs/items-aa-smart-wallets.md)**
- WAL-52 ERC-4337 account and paymaster validation · default P0
- WAL-53 Session key scope, expiry and storage · default P1
- WAL-54 EIP-7702 delegation risks · default P0
- WAL-55 Safe multisig: modules, guards, delegatecall and signature verification · default P0

## Self-check workflow
1. **Identify the type**: wallet (holds user keys) / DApp frontend (requests signatures) / backend (holds service keys or credits and pays out) / smart account. Multiple may apply.
2. **Find all keys**: search `mnemonic|seed|privateKey|secretKey|Keypair|fromSecretKey|HDKey|Wallet\(|privateKeyToAccount|PRIVATE_KEY` and map each key's lifecycle: generate → store → use → back up → rotate → destroy ([items-keys.md](refs/items-keys.md), [items-crypto-libs.md](refs/items-crypto-libs.md)).
3. **Find all signing requests**: search `signMessage|signTypedData|personal_sign|eth_sign|signTransaction|signAllTransactions|signIn|tonProof|signAuthEntry|WebAuth`, and for each ask: can the user understand it? Who verifies it and what is verified ([items-signing.md](refs/items-signing.md), [items-non-evm-signing.md](refs/items-non-evm-signing.md), [signing-standards.md](refs/signing-standards.md))?
4. **Find all transaction sends**: trace the parameters of `writeContract|sendTransaction|sendRawTransaction|submitTransaction` back to constants or to user/URL/API input ([items-dapp-frontend.md](refs/items-dapp-frontend.md), [items-wallet-client.md](refs/items-wallet-client.md)).
5. **Find all crediting and payouts**: event listeners, webhooks, withdrawal APIs, signing services ([items-backend.md](refs/items-backend.md), [items-agent-payments.md](refs/items-agent-payments.md)); draw the state machines: detect → confirm → credit → available; request → risk check → sign → broadcast → confirm.
6. **Run tools**: see the README (semgrep, gitleaks + custom rules, osv-scanner).
7. **Conclusion**: P0/P1 findings include `file:line` + exploit path + impact; mark out-of-repo configuration (DNS, KMS policy, Safe settings) as "needs-verification".

### Noise reduction: usually do **not** report
- Public addresses, ABIs, public RPC URLs, WalletConnect projectId (when domain-restricted) appearing in the frontend.
- Hardhat/Anvil default accounts used in test files (report WAL-12 only when they appear in production config).
- Display issues that are the wallet's responsibility (on the DApp side only report "requested an unnecessary dangerous signature", e.g. WAL-17/18/19).
- Only `X-Frame-Options` missing while signing requires a separate wallet pop-up (P3 suggestion).

---

## Audit perspectives
For a full audit, make one pass per perspective (can be split across sub-agents in parallel); each perspective outputs "checked list + findings".

### 1. Key lifecycle
- List every key (user mnemonic, derived accounts, service hot wallet, relayer, paymaster signer, SIWE/JWT signing key, session keys, deployer) and where it lives.
- For each key answer: entropy source, storage at rest, memory residency, who can trigger signing, whether logs/telemetry could leak it, backup and export, rotation and leak response, balance cap.
- Items: WAL-01–14, WAL-51, WAL-53, WAL-60, WAL-63–69, WAL-83; W3-48.

### 2. Signing and authorization display
- Enumerate all signature types (transactions, EIP-191, EIP-712, Permit/Permit2, SIWE/SIWS, SEP-10/45/53, ton_proof, 7702 authorization, UserOp) and check each against [signing-standards](refs/signing-standards.md): "what the signer sees / what the verifier verifies".
- Check the replay surface: nonce source and consumption, domain, chain, expiry, address comparison, contract wallet support.
- Items: WAL-15–27, WAL-52, WAL-54, WAL-55, WAL-70–82, WAL-84.

### 3. Frontend and supply chain
- Start from "can an attacker change what the user signs": XSS, third-party scripts, dependency poisoning, CDN, DNS/hosting accounts, URL parameters, routing APIs, RPC responses, address display.
- Check CSP, SRI, lockfiles, `postinstall`, integrity monitoring of the live bundle, 2FA on domain and deployment accounts (list out-of-repo items as needs-verification).
- Items: WAL-28–41, WAL-56–59, WAL-61, WAL-62; WEB-29–33, WEB-55.

### 4. Funds in and out
- Crediting: asset allowlist, transaction success, confirmation depth/finality, reorg rollback, memo/tag matching, webhook signature verification, re-check against your own node, periodic reconciliation.
- Payouts: authentication/2FA, address allowlist cooldown, limits, manual review, idempotency, single nonce writer, retries without duplicate payouts, signing service policy, hot wallet sweeping.
- Try: fake tokens, failed transactions, zero-value transfers, missing memo, concurrent withdrawals, retry after RPC timeout, forged webhooks.
- Items: WAL-10, WAL-42–51; WEB-48–51.

### 5. Signing path and key lifecycle (lens)
- Follow [method-signing-key-flow.md](refs/method-signing-key-flow.md): the signing path table (input → decoding → what is shown and from which source → what is signed → where it goes) and the key lifecycle table. Rows marked "signed but not shown", "shown but requester-supplied" or "decided after confirm" are candidates.
- Run the pack's semgrep rules and the lockfile and install-script checks once in Step 2 per [method-static-rules.md](refs/method-static-rules.md); every hit is a lead.
- Items: WAL-15–21, WAL-56–61, WAL-63–83 (signing and key handling seen end to end; the perspectives above still own their items).

---

## Further reading
- Signing standards cheat sheet: [refs/signing-standards.md](refs/signing-standards.md); incidents and lessons: [refs/incidents.md](refs/incidents.md)
- EIP-191 / 712 / 1271 / 2612 / 4337 / 4361 / 6492 / 7702: https://eips.ethereum.org/
- Stellar SEP-10 / 45 / 53 / 29: https://github.com/stellar/stellar-protocol/tree/master/ecosystem
- TON Connect spec: https://github.com/ton-blockchain/ton-connect
- Solana Wallet Standard / Sign In With Solana: https://github.com/anza-xyz/wallet-standard
- SlowMist Knowledge-Base (no license, link only): https://github.com/slowmist/Knowledge-Base
- MetaMask eth-phishing-detect (link only): https://github.com/MetaMask/eth-phishing-detect
- OWASP MASVS (mobile storage and platform, CC-BY-SA, referenced only): https://mas.owasp.org/MASVS/

Files in this skill

  • README.md13.1 KB
  • SKILL.md19.4 KB
  • refs/incidents.md8.3 KB
  • refs/items-aa-smart-wallets.md6.6 KB
  • refs/items-agent-payments.md5.2 KB
  • refs/items-backend.md13.7 KB
  • refs/items-crypto-libs.md18.6 KB
  • refs/items-dapp-frontend.md14.5 KB
  • refs/items-keys.md15 KB
  • refs/items-non-evm-signing.md14.3 KB
  • refs/items-signing.md19.6 KB
  • refs/items-wallet-client.md15.2 KB
  • refs/method-signing-key-flow.md4.3 KB
  • refs/method-static-rules.md4.6 KB
  • refs/signing-standards.md17 KB
  • rules/wallet-dapp.yml26.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.