> 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/high-level-logic-vulnerability.md).

# ثغرة منطقية عالية المستوى

### ثغرة منطقية عالية المستوى

**وصف المختبر**

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

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

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

**تحليل عمل سلة التسوق**

عندما تتم إضافة منتج إلى سلة التسوق، تبدو الطلبية المرسلة كما يلي:

```bash
productId=1&redir=PRODUCT&quantity=1
```

الـ `الكمية` تتم إدارة المعلمة مباشرةً من قِبل العميل ولا يتم التحقق منها بشكل صحيح من جانب الخادم.

**استغلال الخلل المنطقي**

إذا تم تغيير الكمية باستخدام قيمة سالبة، على سبيل المثال:

```bash
productId=1&redir=PRODUCT&quantity=-1
```

ينخفض إجمالي سلة التسوق، مما يؤدي إلى سعر سلبي (مثل \*\* $1337\*\*).

<figure><img src="/files/3396f4337d22277893cd4d5f1301aa532f8b56bc" alt=""><figcaption></figcaption></figure>

ومع ذلك، عند التحقق من سلة التسوق، يحظر التطبيق هذه الحالة بالرسالة:

> *لا يمكن أن يكون إجمالي سعر السلة أقل من صفر*

<figure><img src="/files/781835e267fc04a5eeb54d009dd2fbf13e2b9519" alt=""><figcaption></figcaption></figure>

**تجاوز القيد**

لاستغلال الثغرة:

أضف **السترة المستهدفة** بكمية صالحة:

```bash
productId=1&redir=PRODUCT&quantity=1
```

ثم أضف منتجًا آخر بكمية سالبة لتقليل الإجمالي:

```bash
productId=2&redir=PRODUCT&quantity=-100
```

ينتج عن ذلك إجمالي سالب جدًا (مثل **-$6241.00**).

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

اضبط الكمية السالبة (مثلًا `-17`) بحيث يبقى الإجمالي النهائي **موجبًا**، لكنه منخفض جدًا (أقل من $100).

<figure><img src="/files/fea8194be810c8fda00e5b9159f5c271c0dfcfd3" 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/high-level-logic-vulnerability.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.
