> 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/business-logic/flawed-business-rules.md).

# Schlecht angewandte Geschäftsregeln

### Fehlerhafte Durchsetzung von Geschäftsregeln

Dieses Labor enthält einen logischen Fehler im Kaufprozess. / Das Ziel ist es, diese Schwachstelle auszunutzen, um ein \*\* zu kaufen

Bereitgestellter Bezeichner:

* **Benutzer**: `wiener`
* **Passwort**: `peters`

**Analyse des Gutscheinsystems**

Nach dem Login stellt die Website automatisch einen Willkommensgutschein bereit:

<figure><img src="/files/305545087aa953bdec88b35f88856870c36ad7b4" alt=""><figcaption></figcaption></figure>

**NEWCUST5** → Rabatt von 5 €

<figure><img src="/files/0ebd6f0afe1cf313e625be8e7e193c148098a962" alt=""><figcaption></figcaption></figure>

Dann wird durch das Abonnieren des Newsletters ein zweiter Gutschein vergeben:

<figure><img src="/files/849f946246f07ebc1a3698debc90ae2d5f6b15b0" alt=""><figcaption></figcaption></figure>

* **SIGNUP30** → Rabatt von 30 €

<figure><img src="/files/73721ec8c510c5bf06caf20a4155deae7ad14328" alt=""><figcaption></figcaption></figure>

Jeder Gutschein ist einzeln gültig und funktioniert korrekt, wenn er allein verwendet wird.

<figure><img src="/files/2579eae09481de216b4afc56d2d5e88a1fc523a5" alt="" width="563"><figcaption></figcaption></figure>

**Problem der Geschäftslogik**

Das System prüft die Verwendung von Gutscheinen unzureichend:

* Die Validierung kontrolliert nur \*\*den zuletzt angewendeten Gutschein\*\*
* Es gibt keine Gesamtüberprüfung\*\*, die die Wiederverwendung oder Verkettung derselben Gutscheine verhindert

**Funktionsweise des Fehlers**

Durch das abwechselnde Verwenden der beiden Gutscheine lässt sich die erwartete Logik umgehen:

```bash
NEWCUST5
SIGNUP30
NEWCUST5
SIGNUP30
NEWCUST5
SIGNUP30
```

Jeder neue Gutschein wird akzeptiert, weil die Prüfung nur den vorherigen Gutschein vergleicht.

**Ergebnis**

Durch das Wiederholen dieser Sequenz wird der Gesamtpreis der Jacke schrittweise reduziert auf:

* **Gesamt: 0 €**

<figure><img src="/files/79ae10c647f93adb15efb7d416ac2798032d7b5b" 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 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/business-logic/flawed-business-rules.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.
