| name | wallet-security-review |
| description | Review wallet and application security risks in Genesix. Use when touching wallet lifecycle, session state, key material, storage, signing, transaction construction, Rust FFI, XSWD, logs, clipboard, QR/deep links, networking, permissions, dependencies, or error handling around sensitive data. |
Wallet Security Review
Use this skill for security-sensitive planning, implementation review, and threat modeling.
Sensitive Surfaces
- Key material, seed phrases, private keys, passwords, PINs, mnemonics, and derived secrets.
- Wallet open, close, unlock, session, disposal, and storage lifecycle.
- Transaction creation, signing, serialization, fee calculation, and submission.
- Rust FFI boundaries, generated bridge contracts, and cross-language error handling.
- XSWD and external app/request boundaries.
- Clipboard, QR code, URI/deep link, file import/export, and network inputs.
- Logs, analytics, crash reports, debug output, and user-visible error details.
- Platform permissions, storage backends, web/native differences, and dependency changes.
Review Workflow
- Identify the trust boundary and what input is untrusted.
- Identify what sensitive data can be read, written, logged, cached, copied, serialized, or displayed.
- Evaluate the security tradeoff: benefit, new attack surface, complexity, regression risk, and safer alternatives.
- Check lifecycle ordering for wallet/session open, close, cancellation, and disposal races.
- Verify failures are explicit and do not silently continue with unsafe fallback state.
- Check Rust FFI paths for panics, opaque errors, invalid assumptions, and generated-code impact.
- Check dependency APIs against
pubspec.yaml or Cargo.toml before relying on security behavior.
- Recommend validation from
AGENTS.md plus targeted tests for sensitive behavior when feasible.
Security Rules
- Never log secrets, seed material, private keys, passwords, tokens, raw signatures, or full sensitive payloads.
- Treat all external input as untrusted, including clipboard, QR, URI/deep link, files, XSWD requests, and network responses.
- Prefer allowlists, typed parsing, and explicit validation over ad hoc string handling.
- Keep wallet lifecycle transitions deterministic; avoid double-open, stale session, and use-after-close paths.
- Do not expose lower-level cryptographic or storage errors with sensitive details in UI.
- Avoid broad catch-all recovery in signing, storage, or session code unless the resulting state is explicit and safe.
- Preserve web/native storage differences unless the task explicitly changes them.
- Do not introduce dependency upgrades, crypto changes, or permission expansion without calling out the security implication.
- Prefer smaller, auditable changes when a security benefit can be achieved without expanding attack surface.
Output
Return findings with severity, affected surface, concrete file references, and a specific fix direction. If no issue is found, state the residual risk and validation gaps.