api-pagination
Implement correct, fast API pagination — cursor vs offset trade-offs, opaque cursor encoding, stable sort keys, page-size limits, total-count costs, and…
A deep prevention reference for the OWASP Top 10 web risks — broken access control, injection, crypto failures, insecure design, SSRF and more — with vulnerable-vs-fixed code, edge cases, and a runnable naive-vulnerability scanner.
$ npx -y skills add vanara-agents/skills --skill owasp-top10 --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/owasp-top10Context preview
The summary Claude sees to decide when to auto-load this skill.
A deep prevention reference for the OWASP Top 10 web risks — broken access control, injection, crypto failures, insecure design, SSRF and more — with vulnerable-vs-fixed code, edge cases, and a runnable naive-vulnerability scanner.
name: owasp-top10 description: A deep prevention reference for the OWASP Top 10 web risks — broken access control, injection, crypto failures, insecure design, SSRF and more — with vulnerable-vs-fixed code, edge cases, and a runnable naive-vulnerability scanner. type: skill version: 2.0.0 updated: 2026-06-28
Most real-world breaches exploit a short, well-known list of weaknesses. This package is the deep reference: each category gets its root cause, the default defense, and a vulnerable-vs-fixed example. Category deep-dives live in `references/`, side-by-side fixes in `examples/`, and a runnable heuristic scanner in `scripts/`.
> Based on the OWASP Top 10 (2021). The list shifts over time, but the underlying defenses are durable.
| # | Category | Default defense | |---|---|---| | A01 | **Broken Access Control** | Enforce authorization server-side on every action; deny by default; check ownership (stop IDOR). | | A02 | **Cryptographic Failures** | TLS in transit; encrypt sensitive data at rest; hash passwords with argon2/bcrypt; never roll your own crypto. | | A03 | **Injection** (SQL/cmd/XSS) | Parameterize queries; context-aware output encoding; never concatenate untrusted input. | | A04 | **Insecure Design** | Threat-model before building; secure-by-design defaults; abuse-case thinking. | | A05 | **Security Misconfiguration** | Harden defaults; disable debug in prod; least-privilege; remove unused features. | | A06 | **Vulnerable Components** | Inventory dependencies; patch on a schedule; scan for CVEs (see `vuln-scanner` agent). | | A07 | **Auth Failures** | Strong session handling, MFA, rate-limit logins, no credential stuffing surface (see `secure-auth`). | | A08 | **Software & Data Integrity** | Verify signatures; secure CI/CD; don't deserialize untrusted data. | | A09 | **Logging & Monitoring Failures** | Log security events, alert on them, don't log secrets (see `audit-logging`). | | A10 | **SSRF** | Allow-list outbound destinations; validate/resolve URLs; block internal ranges. |
The bug: the server checks *authentication* (who you are) but not *authorization* (whether you may do this specific thing). Classic IDOR — changing an ID in the URL to read someone else's data.
// VULNERABLE: any logged-in user can read any invoice by guessing an id
app.get('/invoices/:id', auth, async (req, res) => {
const invoice = await db.getInvoice(req.params.id);
res.json(invoice);
});
// FIXED: authorize against ownership, deny by default
app.get('/invoices/:id', auth, async (req, res) => {
const invoice = await db.getInvoice(req.params.id);
if (!invoice || invoice.ownerId !== req.user.id) return res.status(404).end(); // 404 hides existence
res.json(invoice);
});Deep-dive: `references/access-control.md`.
The bug: untrusted input is interpreted as code/query/markup. Defense is structural separation of code from data.
// VULNERABLE: SQL injection
db.query(`SELECT * FROM users WHERE email = '${input}'`);
// FIXED: parameterized query — driver treats input strictly as data
db.query('SELECT * FROM users WHERE email = $1', [input]);SQL, command, and XSS variants with fixes: `references/injection.md` and `examples/sql-injection-fix.md`, `examples/xss-fix.md`.
// VULNERABLE: fetches any URL the user supplies -> attacker hits internal metadata service
const data = await fetch(req.query.url);
// FIXED: allow-list hosts and block internal ranges
const url = new URL(req.query.url);
if (!ALLOWED_HOSTS.has(url.hostname)) return res.status(400).json({ error: 'host not allowed' });
// ...plus resolve DNS and reject private IP ranges (169.254/16, 10/8, 127/8) to stop rebindingDetail and the private-range checks: `references/ssrf-and-design.md`.
whack-a-mole — encode for the output context instead, and allow-list what's permitted.
is sensitive, return `404`, not `403`, so attackers can't enumerate.
`isAdmin`. Allow-list bindable fields.
different context (e.g. a stored value concatenated into a query). Defend at every sink.
output encoding, authz checks, and monitoring.
Input sanitization alone is not a substitute for parameterization/encoding — it's a fragile add-on. And security review (this skill + the `security-auditor` agent) catches code-level bugs, but design-level flaws (A04) need **threat modeling up front** (see the `threat-modeler` agent) — you can't audit your way out of an insecure design.
Pairs with the `security-auditor` agent, the `threat-modeler` agent, and the `secure-auth` and `secrets-management` skills.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Implement correct, fast API pagination — cursor vs offset trade-offs, opaque cursor encoding, stable sort keys, page-size limits, total-count costs, and…
Deep reference for caching — what to cache, cache-aside vs read/write-through/write-behind, TTLs with jitter, eviction (LRU/LFU/FIFO), invalidation, and…
Write Conventional Commits — the type(scope)!: subject + body + footer spec — so history is readable and changelogs and SemVer bumps can be derived…
How to write safe, reversible, zero-downtime database schema migrations — additive-first changes, the expand/migrate/contract pattern, batched backfills,…
How to handle errors explicitly and consistently across an app — validate at boundaries, classify operational vs programmer errors, add context while…
Run git collaboration that scales — trunk-based vs git-flow decided by deploy cadence, branch protection and required checks, PR sizing and review etiquette,…