> 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/high-level-logic-vulnerability.md).

# Hochrangige logische Schwachstelle

### Logikschwachstelle auf hoher Ebene

**Beschreibung des Labs**

Dieses Lab validiert die vom Benutzer bereitgestellten Daten nicht ordnungsgemäß. Es ist möglich, einen logischen Fehler im Kaufprozess auszunutzen, um den Endpreis der Artikel zu ändern. / Das Ziel ist es, die \*\* zu kaufen

Bereitgestellter Bezeichner:

* **Benutzer**: wiener
* **Passwort**: peter

**Analyse der Funktionsweise des Warenkorbs**

Wenn ein Produkt zum Warenkorb hinzugefügt wird, sieht die gesendete Anfrage so aus:

```bash
productId=1&redir=PRODUCT&quantity=1
```

Das `Menge` Parameter wird direkt vom Client gesteuert und serverseitig nicht ordnungsgemäß überprüft.

**Ausnutzung des logischen Fehlers**

Wenn die Menge mit einem negativen Wert geändert wird, zum Beispiel:

```bash
productId=1&redir=PRODUCT&quantity=-1
```

Der Gesamtbetrag des Warenkorbs sinkt, was zu einem negativen Preis führt (z. B. \*\* $1337\*\*).

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

Bei der Validierung des Warenkorbs blockiert die Anwendung diesen Fall jedoch mit der Meldung:

> *Der Gesamtpreis des Warenkorbs darf nicht unter null liegen*

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

**Die Einschränkung umgehen**

Um die Schwachstelle auszunutzen:

Fügen Sie die **Zieljacke** mit einer gültigen Menge:

```bash
productId=1&redir=PRODUCT&quantity=1
```

Fügen Sie dann ein weiteres Produkt mit einer negativen Menge hinzu, um den Gesamtbetrag zu verringern:

```bash
productId=2&redir=PRODUCT&quantity=-100
```

Dies führt zu einem stark negativen Gesamtbetrag (z. B. **-$6241.00**).

<figure><img src="/files/18b41cced677536a41e42ba7243b7eb943183b0c" alt=""><figcaption></figcaption></figure>

Passen Sie die negative Menge an (z. B. `-17`) sodass der Endbetrag weiterhin **positiv**ist, aber sehr niedrig (unter 100 $).

<figure><img src="/files/135efe8d21da1aa344e9a3f2266c9e8228b1e413" 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/business-logic/high-level-logic-vulnerability.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.
