> 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/business-logic/bypassing-flawed-state-machine.md).

# تجاوز عبر آلة حالة معيبة

### تجاوز المصادقة عبر آلة حالة معيبة

يعتمد هذا المختبر على افتراضات غير صحيحة حول تسلسل الخطوات في عملية المصادقة. وباستخدام آلة الحالة سيئة التصميم هذه، يمكن تجاوز المصادقة والوصول إلى واجهة الإدارة وحذف المستخدم **carlos**.

المعرّف المزوَّد:

* **المستخدم:** wiener
* **كلمة المرور:** peter

**الملاحظة الرئيسية**

يُقسَّم مسار الاتصال إلى عدة خطوات متتالية، بما في ذلك خطوة وسيطة لاختيار الدور.

يفترض التطبيق أن جميع الخطوات تُنفَّذ بالترتيب وأنه تم التحقق من صحة كل طلب بشكل صحيح قبل الانتقال إلى التالي.

**مراحل العملية**

1. الاتصال ببيانات صالحة `wiener:peter` بيانات الاعتماد.
2. بعد تسجيل الدخول، يقترح التطبيق خطوة **اختيار الدور**.

<figure><img src="/files/30a88fb767448cc92a44196ef273d493e3ae10f7" alt=""><figcaption></figcaption></figure>

* انقر على «التالي» للمتابعة.
* عند إرسال طلب GET إلى **محدد الدور**، اعترض الطلب.

<figure><img src="/files/1cb33cd16d86fb24c7fcf20597a1ead8b02be883" alt=""><figcaption></figcaption></figure>

**لا تدع الطلب يمر**: احظرْه أو أسقِطه (drop).

* في هذه المرحلة يتم التحقق من الدور.

<figure><img src="/files/5cd8297d525b2b3b284398dbd8e99745b093a32f" alt=""><figcaption></figcaption></figure>

واصل المسار دون هذا التحقق.

**النتيجة**

يعتبر التطبيق خطأً أن جميع الخطوات قد تم التحقق منها بشكل صحيح. / يصل المستخدم مباشرةً إلى \*\*لوحة الإدارة\*\*، دون أن يكون قد اختار أو تحقّق من دور مشروع.

ومن هناك يمكن حذف المستخدم **carlos** والتحقق من المختبر.

<figure><img src="/files/18aa547483d261f83edffd32d928daf4514a62bc" 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/business-logic/bypassing-flawed-state-machine.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.
