Authorization disclaimer. This walkthrough applies only to the intentionally vulnerable PortSwigger Web Security Academy lab linked below. Test only systems you own or are explicitly authorized to assess.
Overview
The application exposes interactive API documentation at /api. The documentation reveals a user-deletion operation, and the backend allows the authenticated wiener account to delete the separate carlos account without an adequate authorization check.

Lab objective/setup
Sign in with the supplied wiener:peter credentials, discover the API documentation, and use the documented interface to delete carlos.
What I observed
Updating the email address on the account page generated API traffic visible in Burp. The browser workflow reached PATCH /api/user/wiener, establishing both the /api prefix and the resource pattern.





Testing parent paths in Repeater showed that /api/user was not a valid collection route, while GET /api returned HTML for an interactive documentation page.



Why it is vulnerable
Two conditions combine here. First, production-accessible documentation discloses operations and parameter formats that the main interface does not advertise. Second, the documented DELETE /api/user/{username} handler accepts a username from the path without adequately ensuring that the current session may delete that account. Documentation exposure accelerates discovery; missing object-level authorization enables the destructive action.
Walkthrough in the authorized PortSwigger lab
- Log in as
wienerand update the email address while Burp records traffic. - Send
PATCH /api/user/wienerto Repeater and progressively test the parent paths. - Request
GET /apiand open the returned interactive documentation in the browser. - Locate
DELETE /api/user/{username}, entercarlos, and execute the documented operation.



Verification
The delete operation returns successfully and the Academy marks the lab solved. The request is performed in wiener‘s session but targets carlos, demonstrating that authentication alone did not enforce permission over the selected user object.
Impact and defensive lesson
An equivalent flaw in a real service could let ordinary users destroy or modify other accounts. Exposed documentation also reduces the effort required to inventory sensitive or legacy operations.
- Enforce object-level authorization on every request, including destructive endpoints.
- Derive self-service account identity from the authenticated principal where possible rather than a client-controlled path value.
- Restrict administrative deletion to explicitly authorized roles and record auditable events.
- Remove, authenticate, or network-restrict interactive documentation in production according to operational need.
- Maintain an accurate API inventory and test documented and undocumented versions consistently.
References
- PortSwigger lab: Exploiting an API endpoint using documentation
- PortSwigger: API testing
- OWASP API1:2023 Broken Object Level Authorization
- OWASP API9:2023 Improper Inventory Management
Provenance
Adapted and rewritten in English from the private migration source declared in the front matter. Technical observations and screenshots are retained from that authorized PortSwigger lab session; no behavior beyond the source evidence is asserted.