> 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/failed-state-machine-workaround.md).

# حل بديل لآلة حالة فاشلة

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

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

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

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

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

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

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

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

1. اتصال باستخدام valid `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/failed-state-machine-workaround.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.
