> 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/cache-poisoning/web-cache-poisoning-with-unkeyed-cookie.md).

# تسميم الذاكرة المؤقتة عبر ملف تعريف ارتباط غير مُفتاحي

### تسميم ذاكرة التخزين المؤقت للويب باستخدام ملف تعريف ارتباط غير مُفهرس

هذا المختبر عرضة لتسميم ذاكرة التخزين المؤقت للويب لأن ملفات تعريف الارتباط غير مُدرجة في مفتاح ذاكرة التخزين المؤقت. يزور مستخدم شرعي الصفحة الرئيسية بانتظام. / الهدف هو تسميم ذاكرة التخزين المؤقت باستجابة تنفّذ `alert(1)` في متصفح الضحية.

#### تحليل الاستجابة

* يتم اعتراض الطلب إلى الجذر (`/`).
* في استجابة HTML، نلاحظ نص JavaScript يحتوي على بيانات ديناميكية:

```javascript
<script>
  data = {
    "host":"0ab5006d03269ea785b94a9e000100c5.web-security-academy.net",
    "path":"/",
    "frontend":"prod-cache-01"
  }
</script>
```

* الـ `الواجهة الأمامية` الحقل هو قيمة ملف تعريف ارتباط يرسله المتصفح

#### ملاحظة ملف تعريف الارتباط

* في الاستعلام، يوجد ملف تعريف ارتباط باسم `fehost` موجود:

```bash
fehost=prod-cache-01
```

* تُعاد استخدام هذه القيمة مباشرةً في الاستجابة دون إدراجها في مفتاح ذاكرة التخزين المؤقت.

<figure><img src="/files/9f1db317cb93cfcb79b613b498c0e61f049113dd" alt=""><figcaption></figcaption></figure>

#### التلاعب بملف تعريف الارتباط

* من خلال تغيير قيمة `fehost` ملف تعريف الارتباط، تنعكس القيمة الجديدة فورًا في الإجابة:

```bash
fehost=test
```

* هذا يؤكد أن ملف تعريف الارتباط **غير مفهرس في ذاكرة التخزين المؤقت** وأنه يؤثر في المحتوى المخزَّن مؤقتًا.

<figure><img src="/files/6f0546ff376df6fff18725e7e3d0d2334112d36f" alt=""><figcaption></figcaption></figure>

#### حقن الحمولة

* ثم يتم حقن قيمة خبيثة في ملف تعريف الارتباط لكسر سياق JavaScript وتنفيذ شيفرة عشوائية:

```javascript
test"-alert(1)-"efffe
```

<figure><img src="/files/363b5ddf23c5bf5526c968f1a35cf3669c531bb2" alt=""><figcaption></figcaption></figure>

* تخرج الحمولة من سلسلة JavaScript وتحقن استدعاءً إلى `alert(1)`.

<figure><img src="/files/15a784d7f5459b30ae3c8952efadb20407edfc59" 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/cache-poisoning/web-cache-poisoning-with-unkeyed-cookie.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.
