Skip to content

davila7/claude-code-templates / .claude-plugin/skills/owasp-security

owasp-security

Unverified

Comprehensive 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".

examples/injection.js

View on GitHub
// SQL Injection Example
// For detailed guidance, see: SKILL.md#section-1-owasp-top-10-2021
//
// This example demonstrates SQL injection via unsafe string concatenation.
// The 'id' parameter is directly concatenated into the SQL query without
// parameterization, allowing attackers to inject malicious SQL code.

const express = require('express');
const app = express();

// ===== VULNERABLE: String Concatenation =====
app.get('/user/unsafe', (req, res) => {
  // VULNERABLE: String concatenation with user input
  const q = "SELECT * FROM users WHERE id = " + req.query.id;
  db.query(q, (err, rows) => {
    if (err) {
      res.status(500).json({ error: "Database error" });
      return;
    }
    res.json(rows);
  });
});

// ===== SECURE: Parameterized Queries =====
app.get('/user/safe', (req, res) => {
  // SECURE: Use parameterized queries (prepared statements)
  const q = "SELECT * FROM users WHERE id = ?";
  const params = [req.query.id];
  
  db.query(q, params, (err, rows) => {
    if (err) {
      res.status(500).json({ error: "Database error" });
      return;
    }
    
    if (rows.length === 0) {
      res.status(404).json({ error: "User not found" });
      return;
    }
    
    res.json(rows);
  });
});

// ===== SECURE: Input Validation + Parameterized Query =====
app.get('/user/safest', (req, res) => {
  const userId = req.query.id;
  
  // Use strict numeric validation: ensure userId contains only digits
  if (!userId || !/^\d+$/.test(userId) || parseInt(userId) <= 0 || !Number.isSafeInteger(parseInt(userId))) {
    res.status(400).json({ error: "Invalid user ID" });
    return;
  }
  
  const q = "SELECT id, name, email FROM users WHERE id = ?";
  const params = [parseInt(userId)];
  
  db.query(q, params, (err, rows) => {
    if (err) {
      console.error("DB Error:", err);
      res.status(500).json({ error: "Internal server error" });
      return;
    }
    
    if (rows.length === 0) {
      res.status(404).json({ error: "User not found" });
      return;
    }
    
    res.json(rows[0]);
  });
});

app.listen(3000);
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: 469kUpdated Claude CodeCodexVerifiedInstall
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: 469kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall