> 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/pt-br/web/business-logic/excessive-trust-in-client-side-controls.md).

# Confiança Excessiva em Controles do Lado do Cliente

### Excesso de confiança em controles do lado do cliente

**Descrição do laboratório**

Este aplicativo não valida corretamente os dados enviados pelo cliente. / É possível explorar uma falha lógica no processo de compra para alterar o preço de um produto. / O objetivo é comprar um \*\*

Identificador fornecido:

* **Usuário**: wiener
* **Senha**: peter

**Análise comportamental**

Um carrinho de compras está disponível no site

<figure><img src="/files/86a5adf8c926233543379e425fdcc6bf4ce886d8" alt=""><figcaption></figcaption></figure>

Ao adicionar um produto ao carrinho, uma **POST** requisição é enviada com vários parâmetros, incluindo o preço.

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

Exemplo de uma requisição observada durante uma adição padrão ao carrinho:

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

O **preço** parâmetro é totalmente controlado pelo cliente e não é verificado corretamente no lado do servidor.

**Exploração**

Ao alterar manualmente o valor do **preço** parâmetro na requisição, por exemplo:

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

<figure><img src="/files/8026d655c21bb293313d21c0f1013ee294000da5" alt=""><figcaption></figcaption></figure>

o servidor aceita a requisição sem realizar uma validação rigorosa.

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

**Resultado**

O produto é adicionado ao carrinho e a compra pode ser validada, apesar de um preço manipulado no lado do cliente. / Isso demonstra uma dependência excessiva de controles do lado do navegador, permitindo que a lógica de negócio esperada seja contornada.

<figure><img src="/files/cfe571533faa6265602f80e5595bb025e86fc37a" 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/pt-br/web/business-logic/excessive-trust-in-client-side-controls.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.
