# Security Auditor

> Use when reviewing authentication, authorization, user input, secrets, API keys, database queries, file uploads, session management, external API calls, OWASP risks, or data handling attack surface.

- **Type:** Skill
- **Install:** `agentstack add skill-cofin-flow-security-auditor`
- **Verified:** Pending review
- **Seller:** [cofin](https://agentstack.voostack.com/s/cofin)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [cofin](https://github.com/cofin)
- **Source:** https://github.com/cofin/flow/tree/main/skills/security-auditor

## Install

```sh
agentstack add skill-cofin-flow-security-auditor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Security Auditor

A security-focused reviewer that evaluates code for vulnerabilities, insecure patterns, and data handling risks. References the `perspectives` critic stance for structured analysis, applied specifically to security concerns.

## Dispatch

Can be dispatched as a subagent by code-review or flow-review workflows when changes touch security-sensitive areas.

## Direct Invocation

- "Security audit this authentication flow"
- "Review this for OWASP vulnerabilities"
- "Check this input handling for injection risks"
- "Audit the data handling in this endpoint"

## Workflow

### Step 1: Apply Persona

Think like an attacker to find exploitable weaknesses, then like a defender for fixes. Severity classification:

- **Critical** — Exploitable now, no preconditions or easily-met ones. Immediate fix required.
- **High** — Exploitable with effort or specific conditions. Fix before shipping.
- **Medium** — Defense-in-depth gap. Doesn't enable direct exploitation but reduces cost of other attacks. Fix next iteration.
- **Low** — Hardening improvement. More robust but no meaningful standalone risk. Fix when convenient.

### Step 2: OWASP Checklist

Work through each category (acknowledge secure categories briefly):

1. **Injection** (SQL, command, XSS) — Is user input sanitized? Are parameterized queries used? Is output encoded for the appropriate context?
2. **Authentication** — Are credentials stored securely (bcrypt/argon2, salted)? Are sessions managed correctly (secure/httpOnly cookies, regenerated on login)? Brute-force protections in place?
3. **Authorization** — Are access controls enforced at every entry point, not just UI? Can users escalate via ID manipulation (IDOR)? Are object-level permissions checked?
4. **Data exposure** — Are secrets hardcoded or committed to version control? Are sensitive fields (passwords, tokens, PII) appearing in logs? Is PII minimized and encrypted at rest?
5. **Input validation** — Is all external input validated at system boundaries? Are type, length, and format constraints enforced? Are file uploads validated for type and content?
6. **Configuration** — Are default credentials changed? Debug endpoints disabled in production? CORS policies restrictive? Security headers present (CSP, HSTS, X-Frame-Options)?
7. **Dependencies** — Known-vulnerable versions in use? Versions pinned (not floating ranges in production)? Unmaintained dependencies?
8. **Cryptography** — Strong algorithms (AES-256, SHA-256+, RSA-2048+, no MD5/SHA-1)? Key rotation? TLS enforced? CSPRNG for security-sensitive random values?

### Step 3: Report Findings

For each finding: OWASP category, severity, realistic attack vector, fix. Categories with no findings acknowledged briefly as secure.

## Guardrails

- Findings must have realistic attack vectors, not theoretical ones requiring impossible preconditions
- Severity must be justified by actual exploitability, not theoretical purity
- Focus on what can actually be exploited given the system context
- Acknowledge when code is secure — thorough input validation and correct auth implementation deserve a note

### Validation Checkpoint

Before delivering findings, verify:

- [ ] Every finding has a realistic attack vector (not theoretical)
- [ ] Severity justified by actual exploitability
- [ ] Fixes are actionable and specific
- [ ] Categories with no findings briefly acknowledged as secure

## Example

**Context:** Security audit of a user lookup API endpoint.

**Finding 1 — Injection (SQL) — Severity: Critical**
`db.query("SELECT * FROM users WHERE id = " + req.params.id)` concatenates user input directly into SQL. Attack vector: `GET /users/1;DROP TABLE users--` executes arbitrary SQL. Fix: use parameterized query `db.query("SELECT * FROM users WHERE id = $1", [req.params.id])`.

**Finding 2 — Data Exposure — Severity: High**
Error handler returns full stack trace in production response body: `res.json({ error: err.stack })`. Attack vector: trigger any error to learn framework version, file paths, and internal method names. Fix: return generic error to client, log stack trace server-side only.

**Finding 3 — Authorization — Severity: High**
Endpoint checks `req.user.isAuthenticated` but not whether the authenticated user owns the requested resource. Attack vector: any authenticated user can access any other user's data via `GET /users/{other_user_id}`. Fix: add `req.user.id === req.params.id` check or implement object-level permission middleware.

**Secure categories:** Authentication (bcrypt with salt, session regeneration on login), Input validation (express-validator with type/length constraints on all parameters), Dependencies (all pinned, no known CVEs).

## References Index

- **[Persona](references/persona.md)** — Role, approach, scope, severity classification, and guardrails
- **[Security Checklist](references/checklist.md)** — Eight OWASP-informed review categories
- **[Critic Stance](../perspectives/references/stances.md)** — Underlying stance prompt with ethical guardrails (from perspectives skill)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [cofin](https://github.com/cofin)
- **Source:** [cofin/flow](https://github.com/cofin/flow)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-cofin-flow-security-auditor
- Seller: https://agentstack.voostack.com/s/cofin
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
