Security Vulnerability & OWASP Code Audit
Audit backend and frontend code for OWASP Top 10 vulnerabilities, authentication bypasses, IDOR, and injection flaws.
Interactive Prompt Playground
{{CODE}}{{TECH_STACK}}{{THREAT_MODEL}}You are a Senior Application Security (AppSec) Engineer conducting a white-box penetration audit.
Examine the following code for security vulnerabilities and compliance risks:
```
app.get('/api/documents/:id', async (req, res) => {
const doc = await db.findOne({ id: req.params.id });
if (!doc) return res.status(404).send('Not found');
res.json(doc);
});
```
Tech Stack: Node.js Express + PostgreSQL
Threat Model Context: Multi-tenant B2B SaaS application handling sensitive financial PDFs
Inspect thoroughly against the OWASP Top 10 and cloud security standards:
1. **Injection (SQLi, NoSQLi, Command Injection, SSRF)**:
- Check dynamic string construction in queries, shell executions, or outbound HTTP requests.
2. **Broken Access Control & IDOR**:
- Check whether tenant IDs or user ownership is validated on every read/write by ID.
3. **Authentication & Session Flaws**:
- Inspect token validation, timing attack vulnerabilities in hash comparisons, and credential leakage.
4. **Sensitive Data Exposure & Cryptography**:
- Check for hardcoded API keys, secrets in logs, weak hashing (MD5/SHA1), or insecure random generators.
5. **CSRF, XSS, & CORS Misconfigurations**:
- Check HTML rendering escaping, dangerous headers (`Access-Control-Allow-Origin: *`), and cookie flags (`HttpOnly`, `SameSite`, `Secure`).
Format your security report:
- 🛡️ **Vulnerability Summary Matrix** (Vulnerability Type, Severity: Critical/High/Medium/Low, CWE Number)
- 💥 **Proof of Concept / Exploit Scenario** (How an attacker could exploit this)
- 🔒 **Remediation Code** (The exact patched, defense-in-depth code)How to Use This Prompt
- Paste any API handler, auth middleware, or sensitive data pipeline.
- Specify your framework and threat model.
- Review the CWE-tagged vulnerability report and fix recommendations.
Engineering Tips & Best Practices
- Always include session context and tenant IDs in database WHERE clauses rather than trusting client-provided IDs alone.
What This Prompt Inspects
Key failure modes, design principles, and quality standards evaluated during execution.
IDOR (Insecure Direct Object Reference)
Checks if user authorization validates tenant ownership when accessing records by ID.
SSRF & Outbound Requests
Verifies user-supplied URLs cannot reach internal VPC or cloud metadata endpoints.
Constant-Time Comparison
Ensures cryptographic signatures and tokens use timing-safe comparison functions.
SprintKit Workflow Integrations
Complementary interactive tools and workflows across SprintKit to accelerate your engineering process.
Related Prompts
Explore related developer prompts in this workflow domain.
Spring Boot REST Service & JPA Code Review
Deep code review for Spring Boot services examining transaction boundaries, JPA N+1 queries, concurrency, and validation.
Pull Request Severity-Graded Code Review
Structured PR review prompt that categorizes findings into Blocker, Major, Minor, and Nitpick with actionable diffs.
Production Dockerfile Multi-Stage Optimization & Hardening
Optimize Dockerfiles for minimal image size, non-root security, layer caching, and CVE vulnerability reduction.