Denial of service and resource limits
14 guides tagged Denial of service and resource limits, grouped by topic, with the SDLC phase and role each is written for.
Application security
6 guidesConvert untrusted office documents and PDFs in an isolated parser
DOCX, XLSX and ODF files are ZIP archives of XML, and PDFs can carry scripts; the converters that read them are large C and C++ programs with a long CVE history. Check the package before any parser reads it, convert each document in a container with no network, no writable root and hard limits, kill it at a deadline, and re-render to pixels when people will open the result.
Design, Development · Developers, AppSec engineers, Platform engineers and SREs
Secure WebRTC signaling, TURN relays and media servers
WebRTC encrypts media, but signaling decides whose keys you trust and TURN relays wherever it is allowed. Authorize every signaling message, mint short-lived TURN credentials, deny internal addresses and harden media servers.
Design, Development · Developers, Platform engineers and SREs
Parse bounded JSON and XML into an explicit application schema
Separate parser capabilities from schema rules, reject ambiguous and coercible inputs, and implement the boundary in a complete Python project.
Development · Developers, AppSec engineers
Prevent business-logic flaws with server-side invariants
Recompute prices on the server, run workflows as state machines, build reset links from configuration, limit valuable flows, and turn each business rule into an invariant that the database and the tests both check.
Planning, Design, Testing · Developers, AppSec engineers
Validate input safely and prevent regex denial of service
Find and fix exponential and quadratic regex backtracking with measured examples, choose linear-time engines or timeouts, and build allowlist validation that decodes once and rejects type confusion and parameter pollution.
Development · Developers, AppSec engineers
Consume third-party APIs safely (OWASP API10:2023)
Treat every upstream and third-party API response as untrusted input: validate it against a schema, set connect and read timeouts, cap the response size, refuse to follow redirects blindly, keep TLS verification on, and scope the credentials you hold for each provider.
Design, Development · Developers, AppSec engineers
Runtime, cloud & APIs
5 guidesBound API work, not just request counts
Protect availability and operating cost with limits on input, per-request work, concurrency, queues, and downstream spending.
Development, Maintenance · Developers, Platform engineers and SREs
Apply security limits to GraphQL, WebSocket and gRPC operations
Carry authorization and resource budgets past the initial HTTP request into resolvers, messages and long-lived streams.
Development, Maintenance · Developers, Platform engineers and SREs
Bound background jobs and make retries safe
Keep queues, workers and paid dependencies within a defined budget when clients retry, cancel or disappear.
Design, Development, Testing, Maintenance · Developers
Operate edge rules without hiding application defects
Tune WAF and abuse controls against legitimate traffic, parser behavior and measurable business effects.
Maintenance · AppSec engineers, Platform engineers and SREs
Keep HTTP services up under application-layer DDoS
Bound every phase of an HTTP request, patch for the HTTP/2 attack classes, rate limit at the edge and the origin, and shed load deliberately, with nginx, Envoy and Node.js settings tested against slow clients and bursts.
Development, Maintenance · Platform engineers and SREs
AI security
3 guidesRed-team LLM applications and agents by their effects
A red-teaming method for LLM features and agents: scope the whole system, map attacks to OWASP and MITRE ATLAS identifiers, score trials from observed effects, report rates with confidence intervals and retest on every model or provider change.
Design, Testing, Security program · Developers, AppSec engineers, Platform engineers and SREs
Bound agent spending, memory and recovery
Enforce budgets and stop conditions outside the model, and make retained context and side effects recoverable.
Design, Development · Developers, AppSec engineers, Platform engineers and SREs
Call a hosted LLM API safely
A code-first checklist for wiring up an OpenAI or Anthropic API call from a backend: keep keys server-side, redact PII before prompts and logs, choose provider retention settings deliberately, validate structured output and still treat it as untrusted, and set timeouts, retries and per-user cost caps.
Design, Development · Developers, AppSec engineers
Practice
Business logic lab: Price an order without trusting the client
A checkout trusts the price and quantity each cart line sends, adds every coupon code it recognizes, and never limits redemptions. Customers can choose their price, order negative quantities and stack discounts. Repair the pricing function so every amount comes from server data and every coupon rule holds.
XXE lab: Parse an uploaded invoice without resolving external entities
An invoice importer parses uploaded XML with a parser that resolves external entities, so a crafted DOCTYPE reads a local file into the response (XXE). Repair parse_invoice so the parser never resolves external entities, loads no DTD and makes no network request.
Pickle deserialization lab: Load a session token without pickle
A session loader parses JSON but falls back to pickle for “legacy” tokens, so a crafted pickle runs code when it is loaded. Repair load_token to parse JSON only and validate it against a fixed schema, and leave no path that unpickles untrusted bytes.
Regular-expression denial of service (ReDoS)
A regular-expression denial of service happens when untrusted input is matched against a pattern whose worst-case running time is super-linear - usually from a nested quantifier such as (X+)+, an overlapping alternation such as (a|aa)+, or a quantified group followed by something that can fail.
Unbounded resource consumption
Unbounded resource consumption happens when a request can make the server spend without limit: an unbounded request body, a batch or page size the caller chooses, or an endpoint with no rate limit, so one client exhausts memory, CPU or the connection pool.