Authentication Bypass
Protected functions or data can be reached without valid credentials, because the authentication check can be skipped or deceived.
| Severity | Critical |
| CVSS 3.1 | 9.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N Open in the calculator |
| CVSS 4.0 | 9.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-288: Authentication Bypass Using an Alternate Path or Channel |
| OWASP Top 10 | A07:2025 Authentication Failures |
| MITRE ATT&CK | T1190 Exploit Public-Facing Application |
| Category | Broken Access Control |
Description
The application requires users to sign in, but an attacker can reach authenticated functions or data without valid credentials because the authentication check can be avoided or deceived. Unlike content that was simply left unprotected, the application does implement authentication; the flaw is that it is not enforced on every path, or that its decision can be influenced by the client.
The attacker needs no account, credentials, user interaction or prior access, and can use protected functions and read or change data, often with the privileges of an authenticated user or administrator. Depending on what lies behind the authentication, this can expose all of the application's data, allow changes to its configuration and users, and provide a starting point for further attacks on the hosting environment. Once found, the bypass is usually simple to automate.
Variants met on tests include: pages or routes protected only by a redirect to the login page, where the protected content is still returned in the body of the redirect response; access checks applied to some forms of a path but not others, bypassed with altered case, a trailing slash, path parameters such as ;, encoded characters or an alternative route to the same handler; sign-in logic that trusts a client-controlled value, such as a cookie or parameter named loggedIn, role or admin; client-side authentication, where a browser or mobile application decides whether sign-in succeeded and the server does not check again; comparisons that succeed without the correct password through type juggling or empty or null values; and headers such as X-Original-URL or X-Forwarded-For trusted to rewrite the path that is checked or to grant access to apparently internal addresses. Each is confirmed by obtaining authenticated content, or performing an authenticated action, from a session that never presented valid credentials.
Remediation
- Enforce authentication on the server for every request to protected content and functions, in one central mechanism such as framework middleware, filters or an API gateway policy, denying by default so that new routes are protected unless explicitly made public.
- When a request is not authenticated, stop processing and return an error or redirect without the protected content; do not rely on the browser following a redirect.
- Base authentication decisions only on a server-side session or a properly verified token, never on cookies, parameters or headers whose values the client controls.
- Normalise the request path once, before both routing and access checks, and make sure that any proxy or gateway and the application interpret paths in the same way.
- Ignore headers such as
X-Original-URL,X-Rewrite-URLandX-Forwarded-Forunless they are set by a trusted proxy, and do not grant access based on source address alone. - Use strict comparisons in authentication code and reject empty or missing credentials explicitly.
Add automated tests that request each protected route without a session and expect it to be refused. Confirm the fix by repeating each bypass technique used in testing.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.