mcpField
O
owasp-top-10

owasp-top-10

github.com/claude-dev-suiteSecurity46311 installsUpdated 3d ago
Repository

About owasp-top-10

A skill that summarizes OWASP Top 10:2025 risks and prevention practices for developers reviewing application security. It provides quick references, examples, scanning commands, and troubleshooting guidance across ten risk categories.

Key features

  1. 01Covers all ten 2025 risk categories
  2. 02Provides prevention guidance and code examples
  3. 03Lists security scanning commands
  4. 04Includes a risk-prevention checklist
  5. 05Offers troubleshooting and anti-pattern guidance

Use cases

  1. 01Reviewing application security risks
  2. 02Checking access control and authentication practices
  3. 03Auditing dependencies and injection defenses
  4. 04Finding remediation guidance for common security issues

MCP support

The skill mentions using `mcp__documentation__fetch_docs` with technology `owasp` to retrieve comprehensive documentation.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill owasp-top-10

After installing, type/owasp-top-10in Claude Code to confirm it loaded.

Details

From the project README

OWASP Top 10:2025

When NOT to Use This Skill

  • OWASP Top 10:2021 - Use owasp skill for 2021 version
  • Detailed secrets management - Use secrets-management skill
  • Detailed supply chain security - Use supply-chain skill for in-depth dependency management
  • License compliance - Use license-compliance skill

Deep Knowledge: Use mcp__documentation__fetch_docs with technology: owasp for comprehensive documentation.

Quick Reference

RankCategoryPrevention
A01Broken Access ControlAuthorization checks, deny by default
A02Security MisconfigurationHardening, security headers, no defaults
A03Supply Chain FailuresDependency audits, lockfiles, SBOMs
A04Cryptographic FailuresStrong algorithms, proper key management
A05InjectionParameterized queries, input validation
A06Insecure DesignThreat modeling, secure patterns
A07Authentication FailuresMFA, rate limiting, secure sessions
A08Integrity FailuresSigned updates, safe deserialization
A09Logging FailuresAudit logs, alerting, monitoring
A10Exception HandlingGraceful errors, no info leakage

A01: Broken Access Control

// Always verify ownership
if (resource.userId !== currentUser.id) {
  throw new ForbiddenException();
}

// Deny by default
const allowed = permissions.includes(requiredPermission);
if (!allowed) throw new ForbiddenException();

// Rate limit sensitive endpoints
app.use('/api/admin/*', adminRateLimiter);

A02: Security Misconfiguration

// Security headers
import helmet from 'helmet';
app.use(helmet());

// Strict CORS
app.use(cors({
  origin: ['https://myapp.com'],
  credentials: true
}));

// Hide errors in production
if (process.env.NODE_ENV === 'production') {
  app.use((err, req, res, next) => {
    res.status(500).json({ error: 'Internal error' });
  });
}

A03: Supply Chain Failures (NEW in 2025)

# Audit dependencies
npm audit
pip-audit
mvn dependency-check:check

# Use lockfiles
npm ci  # Instead of npm install

# Verify package integrity
npm install --ignore-scripts
npm config set ignore-scripts true

A04: Cryptographic Failures

// Strong password hashing
import { hash, verify } from 'argon2';
const hashed = await hash(password, { type: argon2id });

// Secure random
import { randomBytes, randomUUID } from 'crypto';
const token = randomBytes(32).toString('hex');

// AES-256-GCM for encryption (not CBC)

A05: Injection

// SQL - use parameterized queries
const user = await prisma.user.findUnique({ where: { id } });
await db.query('SELECT * FROM users WHERE id = $1', [id]);

// Command - use execFile, not exec
import { execFile } from 'child_process';
execFile('ls', ['-la', safeArg]);

// XSS - sanitize HTML
import DOMPurify from 'dompurify';
element.innerHTML = DOMPurify.sanitize(userInput);

A06: Insecure Design

Key practices:

  • Threat modeling during design phase
  • Secure design patterns (fail-safe, defense in depth)
  • Security requirements in user stories
  • Abuse case testing

A07: Authentication Failures

// Rate limiting
import rateLimit from 'express-rate-limit';
const loginLimiter = rateLimit({
  windowMs: 15 * 60 * 1000,
  max: 5
});

// Secure cookies
res.cookie('session', token, {
  httpOnly: true,
  secure: true,
  sameSite: 'strict'
});

// Strong passwords (12+ chars, mixed)

A08: Integrity Failures

// Verify signatures on updates
// Use subresource integrity (SRI)
<script src="lib.js"
  integrity="sha384-..."
  crossorigin="anonymous">
</script>

// Safe deserialization
// Avoid: JSON.parse(untrusted)
// Use: zod/yup validation

A09: Logging & Alerting Failures

// Log security events
logger.warn({
  event: 'auth_failure',
  userId: attemptedId,
  ip: req.ip,
  timestamp: new Date().toISOString()
});

// Events to log:
// - Login success/failure
// - Password changes
// - Permission denied
// - Rate limit exceeded

A10: Exception Handling (NEW in 2025)

// Graceful error handling
try {
  await riskyOperation();
} catch (error) {
  logger.error({ error, context });
  // Generic response to user
  throw new InternalServerException('Operation failed');
}

// Never expose stack traces
// Never expose internal paths
// Never expose SQL/DB errors

Security Scanning Commands

# Dependencies
npm audit --json
snyk test

# Secrets
gitleaks detect
trufflehog git file://.

# SAST
semgrep --config=p/security-audit .

# Docker
trivy image myimage:latest

Checklist

RiskPrevention
SQL InjectionParameterized queries, ORMs
XSSEscape output, CSP headers
CSRFCSRF tokens, SameSite cookies
Auth issuesMFA, rate limiting, secure sessions
SecretsEnvironment variables, vaults
Supply chainAudit, lockfiles, SBOMs

Anti-Patterns

Anti-PatternWhy It's BadCorrect Approach
Checking permissions in frontend onlyClient-side bypass (A01)Always verify on backend
Using weak crypto (MD5, DES)Easily broken (A04)Use AES-256-GCM, argon2, SHA-256+
npm install in CI/CDNon-deterministic builds (A03)Use npm ci with lockfiles
Catching all exceptions silentlyHides security issues (A10)Log errors, fail gracefully
Trusting user input in queriesInjection attacks (A05)Always use parameterized queries
No session timeoutSession hijacking (A07)Implement idle + absolute timeout

Quick Troubleshooting

IssueLikely CauseSolution
npm audit shows vulnerabilitiesOutdated dependencies (A03)Run npm audit fix or update manually
Login always fails after 5 attemptsRate limiter too strict (A07)Review rate limit settings
Secrets leaked in git historyCommitted .env file (A02)Use BFG to clean history, rotate secrets
Database queries slow/failingSQL injection attack (A05)Review logs, switch to parameterized queries
Users accessing others' dataMissing authorization (A01)Add ownership checks in all endpoints
Stack traces in productionException handling disabled (A10)Enable production error handling

Related Skills

Comments

Markdown supported