Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› HTTP Status Codes
Cyber Security

HTTP Status Codes

← Back to Glossary
By NHI Mgmt Group Updated November 2, 2026 Domain: Cyber Security

HTTP status codes are three-digit numbers in HTTP responses that indicate the outcome of a request. They are grouped into classes such as success, client error and server error, and applications use them to signal whether a request succeeded, failed because of the client, or failed on the server.

What HTTP status codes tell you

HTTP status codes are the protocol’s compact way to describe what happened to a request. In practice, they are part of the control plane of web communication: they let clients, intermediaries, and applications distinguish success from redirect, client-side failure, server-side failure, and authentication or authorization problems.

Because they are machine-readable and standardised, status codes shape how browsers, APIs, load balancers, proxies, and monitoring tools behave. A code is not just a label, it is often the first signal that decides whether the caller retries, stops, follows a new location, prompts for credentials, or treats the response as an error.

How the major status code classes work

Status codes are grouped into five families. 1xx codes are informational and mean the request is still in progress. 2xx indicates success, with 200 being the general success response and 204 indicating success with no response body. 3xx codes indicate redirection, where the client may need to make another request to a different location.

4xx codes indicate a problem with the request. Some are benign input problems, such as 400 for malformed requests, while others expose access-control or session issues, such as 401 for unauthenticated requests and 403 for requests that are understood but not permitted. 404 means the resource was not found, though applications sometimes use it to avoid revealing whether a sensitive resource exists.

5xx codes indicate server-side failure. They tell the caller that the server could not complete the request as intended, often because of a dependency failure, an exception, or temporary overload. For operators, the difference between a 4xx and a 5xx matters because it separates caller mistakes from service defects.

Why HTTP status codes matter in security and operations

Status codes are part of how a system communicates trust boundaries. They can confirm whether authentication succeeded, whether an action is authorised, whether a resource exists, and whether a request was routed successfully through a proxy or gateway. That makes them useful for automation and diagnostics, but also sensitive when they reveal too much detail.

In APIs and web applications, precise status handling improves observability and client behaviour, but inconsistent use can create security and reliability problems. For example, returning the wrong class of code can mask an authorisation failure as a server error, confuse retry logic, or leak information about account state, resource existence, or backend health.

Common implementation mistakes and edge cases

Many problems come from treating status codes as an afterthought instead of part of the application contract. Ambiguous responses, overuse of 500, or returning 200 for failures make incident triage harder and can break client-side logic. In API design, consistent codes are essential for predictable error handling, rate limiting, and incident detection.

Redirection and error handling also need care. A redirect that changes the destination unexpectedly can affect authentication flows, while poorly handled 401 and 403 responses can create confusing user experiences or help an attacker enumerate behaviour. Status codes should align with the actual request outcome, not with what seems easiest to implement.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 addresses the attack and risk surface, while OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV16 — Security Logging and Error HandlingHTTP status codes are central to consistent error signaling and safe failure handling.
Recommendation — Use V16 to return consistent error responses and log failures without exposing sensitive internal details.
OWASP API Security Top 10API5 — Broken Function Level AuthorizationStatus codes often express whether a request is permitted at the function level.
Recommendation — Use API5 to return accurate authorization outcomes and prevent privileged actions from succeeding incorrectly.
NIST SP 800-53 Rev 5AU-2 — Event LoggingStatus code patterns are operational signals that support monitoring and investigation.
Recommendation — Log meaningful HTTP outcomes so operators can detect failures, abuse, and anomalous request patterns.
CIS Controls v8CIS-8 — Audit Log ManagementHTTP response outcomes are useful telemetry for audit and detection workflows.
Recommendation — Centralise and review HTTP outcome logs to improve detection and response.

Practitioner Guidance

Why practitioners should care: Treat status codes as a formal interface, not a cosmetic detail. Clients, gateways, monitoring systems, and security controls often make decisions based on them, so consistency matters for both reliability and access control.

What to watch for: Review whether your application uses the right class of code for authentication, authorisation, validation, redirects, and server failure. Pay particular attention to cases where a response reveals more than intended, or where generic failures hide the root cause from operators.

Practitioner takeaway: Good status code hygiene improves both user experience and security telemetry, because it makes failure modes explicit without exposing unnecessary internal detail.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 2, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org