security-review

Performs security reviews of Hone code using OWASP guidelines. Use when reviewing database queries, CSV import logic, API endpoints, authentication, encryption, or when the user asks about security.

16 stars

Best use case

security-review is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Performs security reviews of Hone code using OWASP guidelines. Use when reviewing database queries, CSV import logic, API endpoints, authentication, encryption, or when the user asks about security.

Teams using security-review should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/security-review/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/security-review/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/security-review/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How security-review Compares

Feature / Agentsecurity-reviewStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Performs security reviews of Hone code using OWASP guidelines. Use when reviewing database queries, CSV import logic, API endpoints, authentication, encryption, or when the user asks about security.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Security Review for Hone

Based on OWASP Top 10 (2021) and modern web security practices.

## OWASP Top 10 Relevance to Hone

### A01:2021 - Broken Access Control
- **Risk**: Unauthorized access to other users' financial data
- **Hone Context**: Currently single-user, but if multi-user is added:
  - Implement proper session management
  - Validate user owns requested resources
  - Use principle of least privilege

### A02:2021 - Cryptographic Failures
- **Data Classification**: Transaction data is sensitive PII
- **At Rest**: SQLCipher for database encryption (per DESIGN.md)
- **In Transit**:
  - All external connections MUST use TLS/HTTPS
  - Ollama connection should use HTTPS if remote
- **Hashing**: Using SHA-256 for deduplication (appropriate choice)

**Database Encryption (Required)**:
```rust
// SQLCipher - open encrypted database
let conn = Connection::open("hone.db")?;
conn.pragma_update(None, "key", &passphrase)?;

// Key derivation - use Argon2 to derive key from user passphrase
use argon2::{Argon2, PasswordHasher};
let salt = SaltString::generate(&mut OsRng);
let argon2 = Argon2::default();
let key = argon2.hash_password(passphrase.as_bytes(), &salt)?;
```

**Implementation Requirements**:
- Use `rusqlite` with `bundled-sqlcipher` feature
- Derive encryption key from passphrase using Argon2
- Passphrase provided at startup (env var or prompt)
- Never log or expose the passphrase

**Backup Encryption**:
- Backups encrypted with `age` before upload to Cloudflare R2
- Consider post-quantum algorithms for future-proofing (harvest now, decrypt later threat)

### A03:2021 - Injection
- **SQL Injection** (Critical for hone-core/src/db.rs)
  - All queries MUST use parameterized statements
  - Never interpolate user input into SQL

```rust
// SECURE - parameterized query
conn.execute(
    "INSERT INTO transactions (account_id, amount) VALUES (?, ?)",
    params![account_id, amount]
)?;

// VULNERABLE - string interpolation
conn.execute(
    &format!("SELECT * FROM transactions WHERE merchant = '{}'", merchant),
    []
)?;
```

- **CSV Injection** (hone-core/src/import.rs)
  - Sanitize fields starting with `=`, `+`, `-`, `@` (Excel formula injection)
  - Validate numeric fields are actually numeric

### A04:2021 - Insecure Design
- **Threat Modeling**: Financial data attracts attackers
- **Defense in Depth**: Multiple layers of validation
- **Secure Defaults**: Restrictive CORS, minimal permissions

### A05:2021 - Security Misconfiguration
- **CORS**: Restrict to specific origins in production

```rust
// Development (permissive)
CorsLayer::permissive()

// Production (restrictive)
CorsLayer::new()
    .allow_origin("https://your-domain.com".parse::<HeaderValue>().unwrap())
    .allow_methods([Method::GET, Method::POST])
```

- **Error Messages**: Never expose stack traces or internal paths
- **Headers**: Set security headers (via tower-http)
  - `X-Content-Type-Options: nosniff`
  - `X-Frame-Options: DENY`
  - `Content-Security-Policy`

### A06:2021 - Vulnerable Components
- Run `cargo audit` regularly (already set up)
- Keep dependencies updated
- Review transitive dependencies

### A07:2021 - Authentication Failures
- Currently N/A (single-user, local)
- If adding auth:
  - Use established libraries (not custom)
  - Implement rate limiting
  - Secure session management

### A08:2021 - Data Integrity Failures
- **CSV Import**: Validate file integrity
  - Check file size limits
  - Validate expected columns exist
  - Reject malformed data gracefully

### A09:2021 - Security Logging
- Log security-relevant events:
  - Failed authentication attempts (if added)
  - Access to sensitive endpoints
  - Import operations
- Don't log sensitive data (transaction details, amounts)

### A10:2021 - SSRF
- **Ollama Integration**: Validate URL is localhost/trusted
- Don't allow user-controlled URLs for HTTP requests

## Frontend Security (React/TypeScript)

### XSS Prevention
- React escapes by default (good)
- Never use `dangerouslySetInnerHTML` with user data
- Sanitize data before rendering if from external source

### Sensitive Data
- Don't store financial data in localStorage/sessionStorage
- Clear sensitive state on logout
- Use httpOnly cookies for auth tokens (if added)

### Content Security Policy
```html
<meta http-equiv="Content-Security-Policy"
      content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
```

## Secrets Management

### Never Commit
- API keys, tokens, passwords
- Database credentials
- Private keys

### Secure Storage
- Use `.env` files (gitignored)
- Environment variables at runtime
- Consider `dotenv` crate for Rust

### Detection Patterns
```
# Patterns that indicate hardcoded secrets
api_key\s*[:=]
password\s*[:=]
secret\s*[:=]
token\s*[:=]
-----BEGIN.*PRIVATE KEY-----
```

## Security Review Checklist

### Database Layer (db.rs)
- [ ] SQLCipher encryption enabled (bundled-sqlcipher feature)
- [ ] Key derived via Argon2 from passphrase
- [ ] All queries use parameterized statements (`params![]`)
- [ ] No string interpolation in SQL
- [ ] Input validation before queries
- [ ] Errors don't expose SQL details

### Import Layer (import.rs)
- [ ] File size limits enforced
- [ ] Path traversal prevented
- [ ] CSV fields sanitized
- [ ] Malformed input handled gracefully

### API Layer (hone-server)
- [ ] Request validation on all endpoints
- [ ] Generic error responses
- [ ] CORS configured appropriately
- [ ] Security headers set

### Frontend (ui/)
- [ ] No sensitive data in localStorage
- [ ] XSS vectors checked
- [ ] CSP headers configured
- [ ] API errors handled gracefully

## Resources

- [OWASP Top 10](https://owasp.org/Top10/)
- [OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/)
- [Rust Security Guidelines](https://rustsec.org/)
- [React Security Best Practices](https://snyk.io/blog/10-react-security-best-practices/)

Related Skills

semgrep-coderabbit-review

16
from diegosouzapw/awesome-omni-skill

Two-stage code review combining fast pattern detection (Semgrep) with AI-powered semantic analysis (CodeRabbit)

security-scanning-threat-mitigation-mapping

16
from diegosouzapw/awesome-omni-skill

Map identified threats to appropriate security controls and mitigations. Use when prioritizing security investments, creating remediation plans, or validating control effectiveness. Use when: the task directly matches threat mitigation mapping responsibilities within plugin security-scanning. Do not use when: a more specific framework or task-focused skill is clearly a better match.

security-scan-dependencies

16
from diegosouzapw/awesome-omni-skill

Scan a deployed website for outdated dependencies, known CVEs, and security misconfigurations.

security-patterns

16
from diegosouzapw/awesome-omni-skill

Zero-trust security patterns for frontend and backend

security-hardening

16
from diegosouzapw/awesome-omni-skill

Security best practices for web applications. Covers OWASP Top 10, authentication, authorization, input validation, CSP, and secure headers.

security-environment-standards

16
from diegosouzapw/awesome-omni-skill

Security and environment configuration standards for web applications, including environment variable management, secure coding practices, and production deployment security. Use when setting up environments, configuring security, or deploying applications.

security-check

16
from diegosouzapw/awesome-omni-skill

Voer geautomatiseerde security checks uit op codebases. Scant broncode, configuraties en dependencies op kwetsbaarheden met Semgrep, Trivy en Gitleaks. Categoriseert findings per OWASP Top 10 met genormaliseerde severity levels. Gebruik bij security scans, PR reviews, of compliance checks.

security-best-practices

16
from diegosouzapw/awesome-omni-skill

Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review/report, or secure-by-default coding help. Trigger only for supported languages (python, javascript/typescript, go). Do not trigger for general code review, debugging, or non-security tasks.

reviewing-python-architecture

16
from diegosouzapw/awesome-omni-skill

Review ADRs to check they follow testing principles and parent PDR constraints. Use when reviewing ADRs or architecture decisions.

review-implementation

16
from diegosouzapw/awesome-omni-skill

Use after hyperpowers:executing-plans completes all tasks - verifies implementation against bd spec, all success criteria met, anti-patterns avoided

review-fix

16
from diegosouzapw/awesome-omni-skill

Read the latest code review, plan fixes for all findings, then execute the fixes — all in one command. Produces a dated plan and execution log in .reviews/.

review-changes

16
from diegosouzapw/awesome-omni-skill

[Review & Quality] Review all uncommitted changes before commit