> 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/ru/web/business-logic/overconfidence-on-the-client-side.md).

# Чрезмерная уверенность на стороне клиента

### Чрезмерное доверие к клиентским механизмам контроля

**Описание лабораторной работы**

Это приложение некорректно проверяет данные, отправляемые клиентом. / Уязвимость логики в процессе покупки можно использовать, чтобы изменить цену товара. / Цель — купить \*\*

Предоставленный идентификатор:

* **Пользователь**: wiener
* **Пароль**: peter

**Анализ поведения**

На сайте доступна корзина покупок

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

При добавлении товара в корзину **POST** отправляется запрос с несколькими параметрами, включая цену.

<figure><img src="/files/4c54fc13b1b25dbdcb7e82654b6eefc325b43533" alt=""><figcaption></figcaption></figure>

Пример запроса, наблюдаемого при стандартном добавлении в корзину:

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

У **цена** параметр полностью контролируется клиентом и не проверяется должным образом на стороне сервера.

**Эксплуатация**

Путём ручного изменения значения **цена** параметра в запросе, например:

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

<figure><img src="/files/58842eb4adf460802dc48da98d8c367da27bcd22" alt=""><figcaption></figcaption></figure>

сервер принимает запрос без строгой проверки.

<figure><img src="/files/92227682a422f5a86e5f216ddb66f52e001fced8" alt=""><figcaption></figcaption></figure>

**Результат**

Товар добавляется в корзину, и покупку можно подтвердить, несмотря на изменённую цену на стороне клиента. / Это демонстрирует чрезмерную зависимость от контроля на стороне браузера, что позволяет обойти ожидаемую бизнес-логику.

<figure><img src="/files/8ee999110aa34cbf27287977fdcbac21be0d9f0c" 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/ru/web/business-logic/overconfidence-on-the-client-side.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.
