# Lab 2: DOM XSS via client-side prototype pollution

Primero ejecutamos lo siguiente:

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

Y luego modificamos la URL:

<figure><img src="/files/8gpypSoDRs0WroekGdxI" alt=""><figcaption></figcaption></figure>

Se puede apreciar el retorno de `foo:bar`

Así que procedemos analizar el código fuente:

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

La linea susceptible a prototype:

```
let config = {params: deparam(new URL(location).searchParams.toString())};
```

Y por lo anterior, se procede a utilizar la siguiente carga:&#x20;

```
?__proto__[transport_url]=foo
```

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

En la evidencia previa, se puede apreciar el src apuntando a foo.

Modificamos nuestro payload para obtener un XSS:

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


---

# Agent Instructions: 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:

```
GET https://books.spartan-cybersec.com/web/prototype-pollution/lab-2-dom-xss-via-client-side-prototype-pollution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
