> 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/de/web/web-cache-deception/web-cache-deception-by-path-manipulation.md).

# Web-Cache-Täuschung durch Pfadmanipulation

### Ausnutzung des Pfad-Mappings für Web-Cache-Deception

#### Ziel des Labs

Den \*\*API-Schlüssel\*\* eines Benutzers wiederherstellen **carlos**. / Bereitgestellte Anmeldedaten: **wiener:peter**.

#### Beobachtungen

* In **Mein Konto** (my-account), der \*\*API-Schlüssel\*\* erscheint **im Klartext** für unseren eigenen Benutzer.

<figure><img src="/files/4536a0fee3e034fd1eddc75b946ea1e6f3d21a2e" alt=""><figcaption></figcaption></figure>

* Zunächst gibt es keinen direkten Hinweis (in der Antwort), dass es **Caching**.

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

* Allerdings zeigt die Anwendung durch Hinzufügen von Segmenten zur URL weiterhin die **my-account** Seite an, was auf eine **Routen-Mapping-Logik** hinweist, die potenziell mit dem Cache kompatibel ist.

Getestete Beispiele:

* `/my-account/TESTTTTTT` → Die Anwendung behandelt dies immer als **my-account**

<figure><img src="/files/9a430e7c3cde22eb377c331e8cbbba52800453e0" alt=""><figcaption></figcaption></figure>

* `/my-account/TESTTT.js` → Erweiterung **.js** wird akzeptiert und interpretiert (nützlich, um Cache-Regeln zu täuschen)

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

Von dem**Exploit-Server**, einen Opfer dazu zwingen, eine URL des Typs „static“ zu laden, die auf my-account verweist:

{% code overflow="wrap" %}

```javascript
<script>
    document.location="https://0afd005204a0683b803d1ce200320070.web-security-academy.net/my-account/jordan.js";
</script>
```

{% endcode %}

<figure><img src="/files/0483c0fbc190ad2b6d751fcc0869664b7432bb0e" alt=""><figcaption></figcaption></figure>

1. Beim Aufrufen von:

* `/my-account/jordan.js`/ ergibt eine Antwort, die den \*\*API-Schlüssel von carlos\*\* anzeigt.

#### Ergebnis

Der API-Schlüssel für **carlos** wird über eine getarnte URL angezeigt (mit `.js` Erweiterung), die es ermöglicht, das Cache-/Routing-Verhalten auszunutzen (`/my-account/<irgendetwas>.js`).

<figure><img src="/files/e031dbd6055db4d8d58cb943c1d2af25c9302067" alt=""><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 dynamically by asking a question.

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

```
GET https://hacking-notes.jord4n.pro/de/web/web-cache-deception/web-cache-deception-by-path-manipulation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
