Back to Skills

security-testing

proffesor-for-testing
Updated Today
80 views
99
21
99
View on GitHub
Othersecurityowaspsastdastvulnerabilitiesauthinjection

About

This Claude Skill systematically tests for security vulnerabilities using OWASP principles, including scanning for injection attacks and validating authentication. It's designed for use during security audits, implementing security practices, or testing authorization. Key capabilities include checking for the OWASP Top 10, dependency vulnerabilities, and exposed secrets.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/proffesor-for-testing/agentic-qe
Git CloneAlternative
git clone https://github.com/proffesor-for-testing/agentic-qe.git ~/.claude/skills/security-testing

Copy and paste this command in Claude Code to install this skill

Documentation

Security Testing

<default_to_action> When testing security or conducting audits:

  1. TEST OWASP Top 10 vulnerabilities systematically
  2. VALIDATE authentication and authorization on every endpoint
  3. SCAN dependencies for known vulnerabilities (npm audit)
  4. CHECK for injection attacks (SQL, XSS, command)
  5. VERIFY secrets aren't exposed in code/logs

Quick Security Checks:

  • Access control → Test horizontal/vertical privilege escalation
  • Crypto → Verify password hashing, HTTPS, no sensitive data exposed
  • Injection → Test SQL injection, XSS, command injection
  • Auth → Test weak passwords, session fixation, MFA enforcement
  • Config → Check error messages don't leak info

Critical Success Factors:

  • Think like an attacker, build like a defender
  • Security is built in, not added at the end
  • Test continuously in CI/CD, not just before release </default_to_action>

Quick Reference Card

When to Use

  • Security audits and penetration testing
  • Testing authentication/authorization
  • Validating input sanitization
  • Reviewing security configuration

OWASP Top 10 (2021)

#VulnerabilityKey Test
1Broken Access ControlUser A accessing User B's data
2Cryptographic FailuresPlaintext passwords, HTTP
3InjectionSQL/XSS/command injection
4Insecure DesignRate limiting, session timeout
5Security MisconfigurationVerbose errors, exposed /admin
6Vulnerable Componentsnpm audit, outdated packages
7Auth FailuresWeak passwords, no MFA
8Integrity FailuresUnsigned updates, malware
9Logging FailuresNo audit trail for breaches
10SSRFServer fetching internal URLs

Tools

TypeToolPurpose
SASTSonarQube, SemgrepStatic code analysis
DASTOWASP ZAP, BurpDynamic scanning
Depsnpm audit, SnykDependency vulnerabilities
Secretsgit-secrets, TruffleHogSecret scanning

Agent Coordination

  • qe-security-scanner: Multi-layer SAST/DAST scanning
  • qe-api-contract-validator: API security testing
  • qe-quality-analyzer: Security code review

Key Vulnerability Tests

1. Broken Access Control

// Horizontal escalation - User A accessing User B's data
test('user cannot access another user\'s order', async () => {
  const userAToken = await login('userA');
  const userBOrder = await createOrder('userB');

  const response = await api.get(`/orders/${userBOrder.id}`, {
    headers: { Authorization: `Bearer ${userAToken}` }
  });
  expect(response.status).toBe(403);
});

// Vertical escalation - Regular user accessing admin
test('regular user cannot access admin', async () => {
  const userToken = await login('regularUser');
  expect((await api.get('/admin/users', {
    headers: { Authorization: `Bearer ${userToken}` }
  })).status).toBe(403);
});

2. Injection Attacks

// SQL Injection
test('prevents SQL injection', async () => {
  const malicious = "' OR '1'='1";
  const response = await api.get(`/products?search=${malicious}`);
  expect(response.body.length).toBeLessThan(100); // Not all products
});

// XSS
test('sanitizes HTML output', async () => {
  const xss = '<script>alert("XSS")</script>';
  await api.post('/comments', { text: xss });

  const html = (await api.get('/comments')).body;
  expect(html).toContain('&lt;script&gt;');
  expect(html).not.toContain('<script>');
});

3. Cryptographic Failures

test('passwords are hashed', async () => {
  await db.users.create({ email: '[email protected]', password: 'MyPassword123' });
  const user = await db.users.findByEmail('[email protected]');

  expect(user.password).not.toBe('MyPassword123');
  expect(user.password).toMatch(/^\$2[aby]\$\d{2}\$/); // bcrypt
});

test('no sensitive data in API response', async () => {
  const response = await api.get('/users/me');
  expect(response.body).not.toHaveProperty('password');
  expect(response.body).not.toHaveProperty('ssn');
});

4. Security Misconfiguration

test('errors don\'t leak sensitive info', async () => {
  const response = await api.post('/login', { email: '[email protected]', password: 'wrong' });
  expect(response.body.error).toBe('Invalid credentials'); // Generic message
});

test('sensitive endpoints not exposed', async () => {
  const endpoints = ['/debug', '/.env', '/.git', '/admin'];
  for (let ep of endpoints) {
    expect((await fetch(`https://example.com${ep}`)).status).not.toBe(200);
  }
});

5. Rate Limiting

test('rate limiting prevents brute force', async () => {
  const responses = [];
  for (let i = 0; i < 20; i++) {
    responses.push(await api.post('/login', { email: '[email protected]', password: 'wrong' }));
  }
  expect(responses.filter(r => r.status === 429).length).toBeGreaterThan(0);
});

Security Checklist

Authentication

  • Strong password requirements (12+ chars)
  • Password hashing (bcrypt, scrypt, Argon2)
  • MFA for sensitive operations
  • Account lockout after failed attempts
  • Session ID changes after login
  • Session timeout

Authorization

  • Check authorization on every request
  • Least privilege principle
  • No horizontal escalation
  • No vertical escalation

Data Protection

  • HTTPS everywhere
  • Encrypted at rest
  • Secrets not in code/logs
  • PII compliance (GDPR)

Input Validation

  • Server-side validation
  • Parameterized queries (no SQL injection)
  • Output encoding (no XSS)
  • Rate limiting

CI/CD Integration

# GitHub Actions
security-checks:
  steps:
    - name: Dependency audit
      run: npm audit --audit-level=high

    - name: SAST scan
      run: npm run sast

    - name: Secret scan
      uses: trufflesecurity/trufflehog@main

    - name: DAST scan
      if: github.ref == 'refs/heads/main'
      run: docker run owasp/zap2docker-stable zap-baseline.py -t https://staging.example.com

Pre-commit hooks:

#!/bin/sh
git-secrets --scan
npm run lint:security

Agent-Assisted Security Testing

// Comprehensive multi-layer scan
await Task("Security Scan", {
  target: 'src/',
  layers: { sast: true, dast: true, dependencies: true, secrets: true },
  severity: ['critical', 'high', 'medium']
}, "qe-security-scanner");

// OWASP Top 10 testing
await Task("OWASP Scan", {
  categories: ['broken-access-control', 'injection', 'cryptographic-failures'],
  depth: 'comprehensive'
}, "qe-security-scanner");

// Validate fix
await Task("Validate Fix", {
  vulnerability: 'CVE-2024-12345',
  expectedResolution: 'upgrade package to v2.0.0',
  retestAfterFix: true
}, "qe-security-scanner");

Agent Coordination Hints

Memory Namespace

aqe/security/
├── scans/*           - Scan results
├── vulnerabilities/* - Found vulnerabilities
├── fixes/*           - Remediation tracking
└── compliance/*      - Compliance status

Fleet Coordination

const securityFleet = await FleetManager.coordinate({
  strategy: 'security-testing',
  agents: [
    'qe-security-scanner',
    'qe-api-contract-validator',
    'qe-quality-analyzer',
    'qe-deployment-readiness'
  ],
  topology: 'parallel'
});

Common Mistakes

❌ Security by Obscurity

Hiding admin at /super-secret-adminUse proper auth

❌ Client-Side Validation Only

JavaScript validation can be bypassed → Always validate server-side

❌ Trusting User Input

Assuming input is safe → Sanitize, validate, escape all input

❌ Hardcoded Secrets

API keys in code → Environment variables, secret management


Related Skills


Remember

Think like an attacker: What would you try to break? Test that. Build like a defender: Assume input is malicious until proven otherwise. Test continuously: Security testing is ongoing, not one-time.

With Agents: Agents automate vulnerability scanning, track remediation, and validate fixes. Use agents to maintain security posture at scale.

GitHub Repository

proffesor-for-testing/agentic-qe
Path: .claude/skills/security-testing
agenticqeagenticsfoundationagentsquality-engineering

Related Skills

network-security-setup

Development

This skill configures network isolation for Claude Code sandboxes by enabling trusted domain whitelisting and custom access policies. It helps developers secure their sandbox environments against prompt injection attacks while managing corporate proxies and internal registries. Use this when you need to control network access and implement zero-trust security for AI code execution.

View skill

sandbox-configurator

Development

The sandbox-configurator skill automatically configures Claude Code sandbox security settings with file system and network isolation boundaries. It specializes in setting up secure execution environments by managing permissions, network policies, and access controls. Use this skill when you need to establish secure isolation boundaries for your code execution sandbox.

View skill

when-mapping-dependencies-use-dependency-mapper

Other

This skill provides comprehensive dependency mapping, analysis, and visualization for software projects across multiple package managers. It extracts dependency trees, detects issues, audits for security vulnerabilities, and generates visual graphs. Use it when you need to understand, analyze, or visualize your project's dependency relationships and security posture.

View skill

github-workflow-automation

Other

This Claude Skill automates GitHub Actions workflows with AI swarm coordination and intelligent CI/CD pipelines. It enables developers to create self-organizing, adaptive workflows for comprehensive repository management and deployment automation. Use it when you need advanced GitHub workflow orchestration with multi-agent AI coordination.

View skill