> 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/flawed-business-rules.md).

# قواعد أعمال مطبقة بشكل سيئ

### التنفيذ المعيب لقواعد العمل

تحتوي هذه المختبرية على خلل منطقي في عملية الشراء. / الهدف هو استغلال هذا الضعف من أجل شراء \*\*

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

* **المستخدم**: `wiener`
* **كلمة المرور**: `بيترز`

**تحليل نظام القسائم**

بعد تسجيل الدخول، يوفّر الموقع تلقائيًا قسيمة ترحيب:

<figure><img src="/files/7f0c33dbfc91074e0a5870ef84a723f18b1ac880" alt=""><figcaption></figcaption></figure>

**NEWCUST5** → خصم 5 €

<figure><img src="/files/51cd1d7c63ff2c93f14b48a007754a50363b8848" alt=""><figcaption></figcaption></figure>

ثم، عند الاشتراك في النشرة الإخبارية، تُمنح قسيمة ثانية:

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

* **SIGNUP30** → خصم 30 €

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

كل قسيمة صالحة بشكل فردي وتعمل بشكل صحيح عند استخدامها وحدها.

<figure><img src="/files/93dc067e55dab4313d1b5fdf2c9a89ef1b32776b" alt="" width="563"><figcaption></figcaption></figure>

**مشكلة في منطق العمل**

يطبّق النظام تحققًا غير كافٍ على استخدام القسائم:

* تتحقق ضوابط التحقق فقط من \*\*آخر قسيمة تم تطبيقها\*\*
* لا يوجد تحقق شامل\*\* يمنع إعادة استخدام القسائم نفسها أو ربطها معًا

**آلية الخلل**

من خلال التناوب بين القسيمتين، يمكن تجاوز المنطق المتوقع:

```bash
NEWCUST5
SIGNUP30
NEWCUST5
SIGNUP30
NEWCUST5
SIGNUP30
```

تُقبل كل قسيمة جديدة لأن التدقيق يقارن القسيمة السابقة فقط.

**النتيجة**

من خلال تكرار هذا التسلسل، ينخفض السعر الإجمالي للسترة تدريجيًا إلى:

* **الإجمالي : 0 €**

<figure><img src="/files/94eecde586a659936db4727882d1288fc43d864d" alt="" width="563"><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/flawed-business-rules.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.
