davila7/claude-code-templates / .claude-plugin/skills/owasp-security
owasp-security
UnverifiedComprehensive OWASP-aligned security guidance across six standards - Top 10 (2021) for web apps, ASVS 5.0, MASVS v2.1.0 for mobile, API Security Top 10 (2023), Kubernetes Top 10 (2022), and the Agentic Applications 2026 edition for AI/LLM. Use for security reviews, vulnerability audits, secure auth/crypto/access-control implementation, Kubernetes manifest hardening, and LLM/agent prompt-injection defense - including indirect requests like "is this login flow secure?", "review this endpoint", or "audit my pod spec".
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 8.5 KB |
| SKILL.md | skill md | 29.2 KB |
| examples/api-auth-bypass.js | script | 3.0 KB |
| examples/broken-access-control.py | script | 7.0 KB |
| examples/cryptographic-failures.js | script | 7.5 KB |
| examples/injection.js | script | 2.0 KB |
| examples/k8s-rbac.yaml | config | 4.5 KB |
| examples/logging-monitoring-failures.py | script | 14.2 KB |
| examples/prompt-injection.txt | markdown | 9.9 KB |
| examples/security-misconfiguration.py | script | 12.0 KB |
| examples/xss.html | other | 4.3 KB |
| owasp-css-instructions.md | markdown | 4.2 KB |
| skill.json | config | 11.9 KB |
examples/api-auth-bypass.js
View on GitHub// API Security Example: OAuth/JWT Token Vulnerability
// For detailed guidance, see: SKILL.md#section-4-owasp-api-security-top-10-2023
//
// This example demonstrates API authentication vulnerabilities including:
// - Broken JWT validation (no signature verification)
// - Missing token expiration checks
// - Overly permissive CORS
// - Function-level authorization bypass
const express = require('express');
const app = express();
// NOTE: The /vulnerable/* and /secure/* routes below live in one file only for
// side-by-side comparison. Express matches routes in registration order, so the
// paths are kept distinct to keep both sets reachable. In a real app the
// vulnerable versions would not exist. (CORS here is illustrative; app-level
// middleware applies globally, so a real deployment would pick one policy.)
// VULNERABLE: CORS allows any origin
const cors = require('cors');
// VULNERABLE: JWT parsed without verification
app.get('/vulnerable/api/orders', cors({ origin: '*' }), (req, res) => {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token' });
// Decoded without verifying signature!
const decoded = Buffer.from(token.split('.')[1], 'base64').toString();
const user = JSON.parse(decoded);
const orders = db.query('SELECT * FROM orders WHERE user_id = ?', user.id);
res.json(orders);
});
// VULNERABLE: Admin endpoint accessible to any authenticated user (no function-level auth)
app.delete('/vulnerable/api/admin/users/:id', cors({ origin: '*' }), (req, res) => {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'Auth required' });
// Only checks if authenticated, not if user is admin!
db.query('DELETE FROM users WHERE id = ?', req.params.id);
res.json({ status: 'deleted' });
});
// SECURE: Proper JWT validation, CORS restriction, function-level authorization
const jwt = require('jsonwebtoken');
const SECRET = process.env.JWT_SECRET;
// SECURE: CORS restricted to a known origin, applied per-route below
const secureCors = cors({ origin: 'https://myapp.com', credentials: true });
const verifyAuth = (req, res, next) => {
const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token' });
try {
const decoded = jwt.verify(token, SECRET, { algorithms: ['HS256'] });
req.user = decoded;
next();
} catch (err) {
return res.status(403).json({ error: 'Invalid token' });
}
};
const requireAdmin = (req, res, next) => {
if (req.user.role !== 'admin') {
return res.status(403).json({ error: 'Admin role required' });
}
next();
};
app.get('/secure/api/orders', secureCors, verifyAuth, (req, res) => {
const orders = db.query('SELECT * FROM orders WHERE user_id = ?', req.user.id);
res.json(orders);
});
app.delete('/secure/api/admin/users/:id', secureCors, verifyAuth, requireAdmin, (req, res) => {
db.query('DELETE FROM users WHERE id = ?', req.params.id);
res.json({ status: 'deleted' });
});
app.listen(3000);
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |