> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/web/access-control/data-filtering-during-redirection-with-parameter-controlled-id.md).

# Data Filtering During Redirection with Parameter Controlled Id

Data Filtering During Redirection with Parameter Controlled Id notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation

### User ID Controlled by Request Parameter with Data Leakage in Redirect

This lab presents an access control vulnerability in which sensitive information is disclosed in the body of a redirect response. / The goal is to get the API key from the carlos user and submit it in solution. / Credentials provided: **wiener:peter**

#### **Analysis and Exploitation**

When we try to access carlos account via:

```bash
/my-account?id=carlos
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b05f0ef7ca39f20e1106e0fa8773f683fa4f67a2%2Fimage%20(275).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

The application automatically redirects us to the login page.

To exploit this, **intercept the redirect response**, which involves modifying the proxy configuration to capture the \*\* responses even without Content-Type\*\* headers.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-95f16091c1b4bcde61ca72349e32813392a9a67c%2Fimage%20(273).png?alt=media" alt=""><figcaption></figcaption></figure>

By intercepting the answer from:

```bash
/my-account?id=carlos
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e1fae8f95b863738d1dfcfc88444a7c1c79ff952%2Fimage%20(274).png?alt=media" alt=""><figcaption></figcaption></figure>

Another approach would have been to configure a rule in the proxy to **replace code 302 Found with a 200 OK**, which would allow the disclosed content to be displayed directly.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5fcd4704d38cb24681016e46f3b957d3e1ffa25e%2Fimage%20(276).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/web/access-control/data-filtering-during-redirection-with-parameter-controlled-id.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
