# Web cache deception

## Lab: Exploiting path mapping for web cache deception

### Enunciado

Para resolver el laboratorio, encuentra la clave API del usuario carlos. Puedes iniciar sesión en tu propia cuenta con las siguientes credenciales:

* **Usuario:** `wiener`
* **Contraseña:** `peter`

### Resolución

Nos logueamos. Mandamos al **Repeater** la petición y vemos que después de **/my-account** no comprueba nada y si mandamos un fichero JavaScript nos indica cuánto está en caché.

<figure><img src="/files/q4mbALhxy6IKTZlsklIQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/69qmSPyZoiKu6d91wfNe" alt=""><figcaption></figcaption></figure>

Si mandamos otra vez ahora nos sale **hit** en **X-Cache**. Esto significa que la URL se ha quedado en la caché.

```
<script>
    document.location="https://0ae200710374a63181a8354b001f00b4.web-security-academy.net/my-account/hola.js"
</script>
```

Lo mandamos a la víctima y antes de los 30 segundos de la caché vemos la API de carlos.

<figure><img src="/files/t2YjMxJA8P7yLkCyQFOc" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://beafn28.gitbook.io/beafn28/web-security/laboratorios-portswigger/web-cache-deception.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
