/viperclaw:viper-rate-limit-dos-resiliencefrom viperclaw
Audits application rate limiting, ReDoS vulnerabilities, and resource exhaustion controls per OWASP API4:2023. Reviews credential throttling, regex complexity, and body-size limits.
Ships in viperclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
viper-rate-limit-dos-resilience)viper_taint_scan, viper_race_burst, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.dbflowchart LR
Req["Incoming Request"] --> Quota["Body Size + Rate-Limit Bucket"] --> Regex["Linear-Time Regex / Bounded Parser"] --> Exec["Timeout-Bounded Worker"]
Single-request Denial of Service (DoS) occurs when a route evaluates a catastrophic backtracking regex (^([a-zA-Z0-9]+)+$) on a 50-character string (freezing the Python GIL or Node.js event loop for minutes), accepts multi-gigabyte request bodies or JSON/XML bodies without Content-Length caps, or allows unlimited credential-guessing attempts on 6-digit OTPs.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "re\.(compile|match|search|sub)\(.*(\+\)|\*\))[\+\*\{]"
rg -n "(MAX_CONTENT_LENGTH|client_max_body_size|bodyParser\.json\(\{.*limit)"
rg -n "(ratelimit|RateLimiter|SlowAPI|throttler)"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
DOS-01 | Auth & OTP Credential-Throttling Limits | Login, 2FA/OTP verification, and password reset enforce strict per-account AND per-IP rate limits (e.g., max 5 attempts per 15m before invalidating the OTP). | 6-digit OTP endpoint allows 1,000,000 requests without invalidating the code or locking out. |
DOS-02 | Zero Catastrophic Backtracking Regexes (ReDoS) | All regular expressions evaluated on user input avoid nested quantifiers ((a+)+, `(a | aa)+, ([a-z]+)*), or use linear-time google-re2`. |
DOS-03 | Request Body & Multipart Size Caps | Web server and framework enforce explicit body size limits (e.g., 1MB for JSON APIs, 10MB for uploads). | Missing MAX_CONTENT_LENGTH allows a single POST of 2GB JSON to OOM-kill the worker pod. |
DOS-04 | Expensive Operation & AI/Export Quotas | PDF generation, CSV exports, password hashing, and LLM API routes enforce strict per-user concurrency and daily quota caps. | Unthrottled /api/export-all or /api/chat route allows exhausting DB CPU or LLM billing. |
DOS-05 | Password Input Length Cap Before Hashing (<= 128 bytes) | Password strings are capped at <= 128 characters before passing to bcrypt / Argon2 / PBKDF2. | Passing a 10MB password string into PBKDF2 / Argon2 blocks the worker thread for several seconds per request. |
DOS-06 | Trusted Proxy IP Resolution for Rate Limiters | Rate limiters extract client IP from the rightmost trusted proxy hop, never an unvalidated client X-Forwarded-For header. | Clients send arbitrary X-Forwarded-For: 1.2.3.4 headers to circumvent IP rate limiting. |
DOS-07 | Database & Upstream Outbound Timeouts | Every DB query (statement_timeout) and outbound HTTP/RPC call defines an explicit timeout (e.g., 3s–10s). | requests.get(url) called without timeout=, hanging worker threads indefinitely when upstream stalls. |
DOS-08 | JSON Nesting Depth & Array Length Bounds | JSON parsers and schema validators cap maximum object nesting depth and array element counts. | 10,000-element array passed to a batch endpoint triggers $O(N^2)$ processing or 10,000 sequential DB queries. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| HIGH (8.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | Missing rate limit and attempt cap on 4/6-digit OTP/reset code allowing trivial account takeover. |
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | Unauthenticated ReDoS regex or unbounded memory allocation crashing the application server in a single request. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L | Rate limit avoidable via untrusted X-Forwarded-For header or missing password max-length cap. |
# ❌ VULNERABLE: Catastrophic backtracking regex (ReDoS) & uncapped password length into bcrypt
SLUG_RE = re.compile(r"^([a-z0-9]+(-[a-z0-9]+)*)+$")
def verify_login(slug: str, password: str, stored_hash: bytes) -> bool:
if not SLUG_RE.match(slug):
return False
return bcrypt.checkpw(password.encode("utf-8"), stored_hash)
# ✅ HARDENED: Linear-time non-nested regex + strict input length caps before hashing
SLUG_RE = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
def verify_login(slug: str, password: str, stored_hash: bytes) -> bool:
if len(slug) > 64 or len(password) > 128 or not SLUG_RE.match(slug):
return False
return bcrypt.checkpw(password.encode("utf-8"), stored_hash)
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
rate-limiting, redos, resource-exhaustion, owasp-api4, security-audit
72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas./viper-auth-oauth-jwtAuthentication, OAuth 2.0 / OIDC & JWT Security Auditor. Reviews token verification, algorithm allowlisting, claim validation, and OAuth redirect_uri configurations./viper-aws-iam-cloud-auditAWS IAM, STS, S3, KMS & Lambda Security Auditor (modeled on Prowler, Parliament & CloudSplaining). Reviews iam:PassRole escalation, STS ExternalId, S3 policies, and IMDSv2./viper-bola-idorObject & Function-Level Authorization (BOLA / BFLA) Audit Skill. Reviews resource access controls, tenant scoping, and ownership checks across API endpoints and controllers.npx claudepluginhub zahidoverflow/viperclaw --plugin viperclawOther plugins' skills for the same job