Medium severityGoInsecure ConfigurationMEDIUM confidence
HTTP Server No Timeouts
An http.Server is constructed without ReadTimeout / ReadHeaderTimeout (CWE-400/CWE-1188).
Standards mapping
- CWE
- CWE-400: Uncontrolled Resource ConsumptionCWE-1188: Initialization of a Resource with an Insecure Default
- OWASP Top 10
- A05:2021 - Security Misconfiguration
- OWASP ASVS
- V14.3.2 (L1)
Vulnerable vs. safe
Flagged by this check
return http.Server{Addr: ":8080", Handler: mux}Passes - the safe pattern
return http.Server{Addr: ":8080", Handler: mux, ReadTimeout: 5 * time.Second, ReadHeaderTimeout: 2 * time.Second}Why it matters & how to fix it
An http.Server is constructed without ReadTimeout / ReadHeaderTimeout (CWE-400/CWE-1188). With no timeouts a slow or malicious client (e.g. Slowloris) can hold connections open indefinitely and exhaust server resources. Set ReadTimeout, ReadHeaderTimeout, WriteTimeout, and IdleTimeout to bounded values.
References
Rule ID integsec-go-http-server-no-timeouts - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Insecure ConfigurationCORS Acao Wildcard Header
- JavaScript / TypeScript - Insecure ConfigurationCORS Wildcard Origin
- JavaScript / TypeScript - Insecure ConfigurationCORS Wildcard With Credentials
- JavaScript / TypeScript - Insecure ConfigurationCSRF Protection Disabled
- JavaScript / TypeScript - Insecure ConfigurationExpress Trust Proxy All
- JavaScript / TypeScript - Insecure ConfigurationExpress X Powered By Enabled