model-dos
Skill20 starsChanged 4 months agoMITView on GitHub
Detects LLM endpoints missing token caps, rate limits, or prompt-length
In this repository52 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- authentication-failuresSkill
- broken-access-controlSkill
- concurrency-correctnessSkill
- contract-reviewSkill
- cryptographic-failuresSkill
- crypto-library-misuseSkill
- csrfSkill
- exceptional-conditionsSkill
- excessive-agencySkill
- file-uploadSkill
- graphql-securitySkill
- hardcoded-secretsSkill
- header-injectionSkill
- hotspotsSkill
- injectionSkill
- insecure-designSkill
- insecure-local-storageSkill
- insecure-output-handlingSkill
- insecure-plugin-designSkill
- integrity-failuresSkill
- ipc-securitySkill
- llm-supply-chainSkill
- logging-failuresSkill
- mass-assignmentSkill
- mcp-securitySkill
- memory-api-misuseSkill
- model-theftSkill
- multi-agent-trustSkill
- nosql-injectionSkill
- numeric-trust-boundarySkill
- oauth-implementationSkill
- open-redirectSkill
- overrelianceSkill
- path-traversalSkill
- privilege-handlingSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- pr-reviewSkill
- race-conditionSkill
- rag-securitySkill
- redosSkill
- security-cleanupSkill
- security-misconfigurationSkill
- security-reviewSkill
- sensitive-disclosureSkill
- ssrfSkill
- supply-chainSkill
- threat-modelSkill
- token-smugglingSkill
- training-data-poisoningSkill
- unsafe-api-consumptionSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
No input length validation before sending to the inference endpoint
- Distinctive: line 23
No per-user or per-IP rate limiting on the prompt endpoint
- Distinctive: line 33
Prompt input is length-capped at the handler boundary: before it reaches the inference client.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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_tokensparameter — 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:
- 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.
- 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.
- 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.
- 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.
- 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

