Timeout configured on all HTTP requests
Why it matters
HTTP requests without timeouts block indefinitely when a server stops responding without closing the TCP connection — a common failure mode in cloud environments during rolling restarts or network partitions. CWE-400 (uncontrolled resource consumption) applies: a single hung request holds a thread, connection slot, or serverless concurrency unit until the platform forcibly kills it — typically after 30+ seconds. At scale, simultaneous slow requests exhaust your connection pool entirely, making the application unresponsive for all users.
Severity rationale
Medium because requests without timeouts deplete connection pools and serverless concurrency under partial network failures, causing application-wide unavailability.
Remediation
Set explicit timeouts on every HTTP client. Use AbortController for native fetch; set timeout on axios instances. Never rely on platform-level request timeouts alone.
// lib/fetch.ts — fetch with timeout
export async function fetchWithTimeout(
url: string,
options: RequestInit = {},
timeoutMs = 10_000
): Promise<Response> {
const controller = new AbortController()
const id = setTimeout(() => controller.abort(), timeoutMs)
try {
return await fetch(url, { ...options, signal: controller.signal })
} finally {
clearTimeout(id)
}
}
Default to 10 seconds for user-facing requests, 30 seconds for background jobs. Document the timeout value alongside each integration so it's visible during code review.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Error Resilience Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-400 — Uncontrolled Resource Consumption
- iso-25010:2011 · reliability.fault-tolerance
- soc2:2017 · A1.1 — Processing capacity monitoring and management
Taxons
History
- 2026-04-18·v1.0.0·Initial import from error-resilience·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (A1.1) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2