Use this when hardening HTTP responses and behaviour.
HTTP Security
HTTP security covers protecting web traffic and responses: HTTPS everywhere, security headers, secure cookies, correct methods and status codes, and limiting what error pages reveal.
1. HTTP security: TLS, security headers, safe methods, no info leaks.
2. Disable TRACE.
3. Remove version banners.
4. Secure cookies.
5. Rate limiting.
request → server config → response headers
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Quick checks Verify boundary
curl -sI https://example.com | grep -iE 'strict-transport|content-security|x-frame|x-content-type|referrer|set-cookie|server'
Look for missing security headers, version-revealing Server/X-Powered-By headers, and cookies without Secure, HttpOnly and SameSite.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Serve everything over HTTPS.
- Add security headers.
- Keep error pages minimal.
curl -sI https://<site>— security headers- HTTP methods allowed — curl -X OPTIONS -i
- Server version disclosure — header review
ReferenceWhy it matters1 section · depth on demand
Checklist
- HTTPS only, with HSTS.
- Security headers: CSP, X-Content-Type-Options, Referrer-Policy, frame-ancestors.
- Cookies: Secure, HttpOnly, SameSite.
- Only needed HTTP methods; reject others with 405.
- No stack traces or version banners in responses.
- Rate limiting on login and expensive endpoints.
Check with browser developer tools, curl -I and scanners such as OWASP ZAP.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
HTTP security covers how web servers and applications use HTTP features to protect users: HTTPS, secure cookies, security headers, correct caching, safe methods and error handling. Many protections are simple header settings with large effect.
| Area | Practice |
|---|---|
| Transport | HTTPS only, HSTS |
| Headers | CSP, X-Content-Type-Options, Referrer-Policy, frame-ancestors |
| Cookies | Secure, HttpOnly, SameSite |
| Caching | Cache-Control: no-store for sensitive responses |
| Methods | Only needed methods enabled; no TRACE |
| Errors | Generic error pages, no stack traces |
| Disclosure | Remove version banners (Server, X-Powered-By) |
curl -sI https://example.com | grep -iE 'strict|content-security|x-content|referrer|server'
Status codes and security
| Code | Security note |
|---|---|
| 301/302 to HTTPS | Combine with HSTS |
| 401 vs 403 | 401 = not authenticated, 403 = not allowed; do not leak which resources exist |
| 404 for unauthorised objects | Avoids revealing existence (IDOR) |
| 429 | Rate limiting |
| 500 | Should not show stack traces |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Web Security → HTTP Security. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://owasp.org/www-project-application-security-verification-standard/ · confidence 94%