Authorization disclaimer. This walkthrough is exclusively for the intentionally vulnerable PortSwigger Web Security Academy lab linked below. Only test systems you own or are explicitly authorized to assess.
Overview
The front-end component blocks requests whose visible URL begins with /admin, but the backend honors X-Original-URL when selecting a route. Supplying an innocuous request target while placing the protected path in that header makes the two layers enforce different URLs.

Lab objective/setup
Reach the administrative functionality and delete the synthetic user carlos. The lab hint identifies X-Original-URL as a header worth testing.
What I observed
The application exposed an admin link, but a direct request to /admin returned an unauthorized response. Sending a request to / with X-Original-URL: /admin instead returned the administration panel, demonstrating that the backend used the header for routing after the front end had inspected the request line.



Why it is vulnerable
Authorization is applied to one representation of the URL while routing uses another. Because the client can supply the override header, a request may pass the proxy’s path rule and still reach a privileged backend handler. Access control must be based on a single normalized route and repeated at the application endpoint.
Walkthrough in the authorized PortSwigger lab
- Confirm that requesting
/admindirectly is denied. - Send a request to
/withX-Original-URL: /adminto establish the parsing discrepancy. - Keep the visible target outside
/admin, place the action path in the header, and carry the username in the query string:
1 | GET /?username=carlos |
- Replay the request inside the lab session.



Verification
The same account is denied when /admin appears in the request line but receives the panel when the path is supplied through X-Original-URL. The Academy marks the lab solved after the header-based delete request.
Impact and defensive lesson
In a real system, this discrepancy could expose every route protected only by an upstream URL rule. Strip untrusted rewrite headers at the edge, normalize paths consistently, and enforce authorization in each backend handler rather than relying solely on proxy filtering.