Sc rate limiting

From ersinkoc/security-check · View interactive version

Sc rate limiting is an AI agent skill from the GitHub repository ersinkoc/security-check. Missing rate limiting and application-level DoS vector detection — ReDoS, query complexity, resource exhaustion

How to use this skill

Skill file

SC: Rate Limiting & DoS Vectors

Purpose

Detects missing rate limiting on sensitive endpoints and application-level denial-of-service vectors including ReDoS patterns, GraphQL complexity attacks, large payload attacks, pagination abuse, connection pool exhaustion, and resource-intensive operations without throttling.

Activation

Called by sc-orchestrator during Phase 2. Runs against all web applications and APIs.

Phase 1: Discovery

Keyword Patterns to Search

"rateLimit", "rate_limit", "throttle", "RateLimiter",
"express-rate-limit", "slowapi", "throttle_classes",
"@Throttle", "bucket", "leaky", "sliding_window"

Checks

1. Missing Rate Limiting on Sensitive Endpoints:

2. ReDoS (Regular Expression Denial of Service):

// VULNERABLE: Catastrophic backtracking
const emailRegex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
// Input: "aaaaaaaaaaaaaaaaaaaaaaaa!" causes exponential backtracking

// SAFE: Non-backtracking regex or use validator library
const { isEmail } = require('validator');

3. Pagination Abuse:

// VULNERABLE: No upper bound on limit
app.get('/api/users', (req, res) => {
  const limit = parseInt(req.query.limit) || 10;
  // limit=999999 returns entire database!
});

// SAFE: Cap the limit
const limit = Math.min(parseInt(req.query.limit) || 10, 100);

4. Request Size Limits:

// VULNERABLE: No body size limit
app.use(express.json());  // Default: 100kb, but should be explicitly set

// SAFE: Explicit limit
app.use(express.json({ limit: '1mb' }));

Severity Classification

Output Format

Finding: RATE-{NNN}

Common False Positives

  1. Rate limiting at infrastructure level — API gateway, CDN, or WAF rate limiting
  2. Internal/admin endpoints — internal tools with network-level access control
  3. Safe regex patterns — regex without nested quantifiers or alternation
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.