Skip to content
Skills Library
Security · Review & audit

model-dos

/model-dos

Detects LLM endpoints missing token caps, rate limits, or prompt-length bounds, enabling cost and resource exhaustion. Use when writing LLM API call handlers, setting up inference endpoints, implementing chatbot backends, or configuring token limits for LLM services. Also invoke when accepting user- provided prompts without length constraints.

Repository
soundcheck ↗
Licence
MIT
Last repository change
30.07.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 30.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Detects LLM endpoints missing token caps, rate limits, or prompt-length bounds, enabling cost and resource exhaustion. Use when writing LLM API call handlers, setting up inference endpoints, implementing chatbot backends, or configuring token limits for LLM services. Also invoke when accepting user- provided prompts without length constraints.

Original author description

Detects LLM endpoints missing token caps, rate limits, or prompt-length bounds, enabling cost and resource exhaustion. Use when writing LLM API call handlers, setting up inference endpoints, implementing chatbot backends, or configuring token limits for LLM services. Also invoke when accepting user- provided prompts without length constraints.

How it works

  1. What this checks
  2. Vulnerable patterns
  3. Fix immediately
  4. Verification
  5. References
Original SKILL.md headings · 59 lines, 509 words
SKILL.md preview
---
name: model-dos
description: Detects LLM endpoints missing token caps, rate limits, or prompt-length
  bounds, enabling cost and resource exhaustion. Use when writing LLM API call
  handlers, setting up inference endpoints, implementing chatbot backends, or
  configuring token limits for LLM services. Also invoke when accepting user-
  provided prompts without length constraints.
---

# Model Denial of Service Security Check (OWASP LLM04:2025)

## What this checks

Protects against resource exhaustion caused by unbounded prompts, missing token caps,
or absent rate limiting. Attackers can submit enormous or recursive inputs that inflate
inference costs, saturate GPU/CPU, and deny service to legitimate users.

## Vulnerable patterns

- LLM API calls with no `max_tokens` parameter — model generates until its internal limit
- No input length validation before sending to the inference endpoint
- Multi-turn chat that accumulates context indefinitely across turns
- No per-user or per-IP rate limiting on the prompt endpoint

## Fix immediately

Flag the vulnerable code and explain the risk. Then suggest a fix that establishes
these properties:

1. **Every LLM call sets an explicit output cap** — the provider's max-tokens
   parameter or its equivalent. Leaving it at the provider default lets a single
   request run for minutes and rack up dollars in tokens.
2. **Prompt input is length-capped at the handler boundary** before it reaches the
   inference client. Measured in chars, bytes, or tokens — the exact unit does not
   matter as long as the cap runs before the upstream call.
3. **Conversation context is bounded.** Either the handler is stateless
   single-turn, or accumulated history is trimmed to a fixed turn or token
   budget before every call. Unbounded history is an attacker's favorite
   amplifier.
4. **Per-identifier throttling** (per user, per API key, per IP) runs on every
   LLM endpoint. In-process token bucket, framework middleware, or reverse-proxy
   rule — anything that survives alias and batch tricks and prevents one caller
   from pinning the endpoint.
5. **Every inference call has a deadline.** SDK timeout, HTTP client timeout, or
   request-context cancellation — a hung upstream must not be able to
   indefinitely occupy a worker.

Translate each principle to the inference SDK, web framework, and rate-limiter of
the audited file. Use the SDK's documented cap and timeout parameters — do not rely
on global defaults.

## Verification

Confirm the following *properties* hold (language-agnostic):

- [ ] Every LLM API call sets an explicit output cap on generated tokens — never left to the provider default
- [ ] Caller-supplied prompt text is length-capped (chars, bytes, or tokens) and rejected at the handler boundary before reaching the inference client
- [ ] Conversation context fed to the model is bounded: either the handler is single-turn and stores no history at all, or any accumulated history is trimmed to a fixed turn/token budget before the call
- [ ] Every LLM endpoint enforces a per-identifier throttle (per user, per API key, or per IP) through any mechanism — in-process bucket, framework middleware, reverse-proxy rule — not just a global concurrency cap
- [ ] Every inference call runs under an explicit deadline expressed through any available mechanism — SDK timeout parameter, HTTP client read/write timeout, request context or cancellation deadline, or framework-level request timeout — so a hung upstream cannot pin a worker indefinitely

## References

- CWE-400 ([Uncontrolled Resource Consumption](https://cwe.mitre.org/data/definitions/400.html))
- CWE-770 ([Allocation of Resources Without Limits or Throttling](https://cwe.mitre.org/data/definitions/770.html))
- [OWASP LLM04:2025 Model Denial of Service](https://genai.owasp.org/llmrisk/llm04-model-denial-of-service/)

Versions

The database has no other skills named model-dos.

Database snapshot: 13.11.2026 · package version 9dd41a83cfdc (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100prompt-injection
    Detects LLM prompts built from user input or retrieved documents that let attackers hijack the model's instructions. Use when writing code that constructs LLM prompts from user input, builds system prompts, implements RAG pipelines, or processes external documents fed to a…
  • 90production-ai-agents
    Use when building an LLM agent, chatbot, RAG or tool-calling feature, choosing a model or provider, writing or changing prompts, managing context, latency or token cost, building LLM evals, or letting an AI change data.
  • 90rate-limiting-review
    Finds missing rate limits and denial-of-service surfaces on authentication endpoints, bulk operations, expensive queries and WebSocket handlers. Use when docs or routes describe login, registration, OTP or MFA checks, password reset, exports, bulk or expensive endpoints.
  • 100token-cost-analyzer
    Use this skill when analyzing and optimizing LLM API costs. Activate when the user wants to reduce AI API spending, understand token usage, audit LLM costs, optimize prompts for cost efficiency, or track and report on AI expenditure.
  • 86api-cost-review
    Review application code that calls the Claude API / Anthropic SDK for token and cost optimizations (prompt caching, batching, model routing, output limits). Use when the user asks to cut API cost or review LLM call sites.
  • 100rate-limiting-and-security
    This skill should be used when the user is implementing rate limiting, choosing rate limit algorithms, adding rate limit headers, securing API endpoints, preventing OWASP API Top 10 vulnerabilities, configuring CORS, validating input, or implementing request signing. Covers…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.