> 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 nos controles do lado do cliente

Notas sobre confiança excessiva nos controles do lado do cliente para os laboratórios do PortSwigger Web Security Academy, incluindo fluxo de exploração, teste de payload, validação no Burp Suite e contexto de remediação.

### Confiança Excessiva 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="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a518f74082d216dec39d2dfb180172bf9c308540%2Fimage%20(211).png?alt=media" 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="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0a517746bd8fc36116bd79b78748079fff8e2a67%2Fimage%20(212).png?alt=media" 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="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-5101c358ee4566d933bba1ae55d72409002383de%2Fimage%20(213).png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-84cc9832143a7d7ded50676bec507df73e043b1e%2Fimage%20(214).png?alt=media" alt=""><figcaption></figcaption></figure>

**Resultado**

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

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-952cf8501c39e41194c8499712caa327675f17d1%2Fimage%20(215).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/pt-br/web/business-logic/excessive-trust-in-client-side-controls.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
