> ## Documentation Index
> Fetch the complete documentation index at: https://rootea.es/llms.txt
> Use this file to discover all available pages before exploring further.

# DOM XSS in document.write sink using source location.search inside a select element

> PortSwigger Web Security Academy lab: DOM XSS in document.write sink using source location.search inside a select element. Topic: Cross-Site Scripting (XSS).

# DOM XSS in document.write sink using source location.search inside a select element

<p className="machine-summary"><span className="prompt"><code>\$ tldr</code></span> PortSwigger · Cross-Site Scripting (XSS)</p>

<div className="machine-meta">
  | ·            | ·                                                                                                                         |
  | ------------ | ------------------------------------------------------------------------------------------------------------------------- |
  | Platform     | PortSwigger Web Security Academy                                                                                          |
  | Topic        | Cross-Site Scripting (XSS)                                                                                                |
  | Difficulty   | <span className="dbadge dbadge-medium">PRACTITIONER</span>                                                                |
  | Official lab | [Open](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-document-write-sink-inside-select-element) |
</div>

## Solve the lab

| Language | Author          | Format | Link                                                                                                                      |
| -------- | --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| 🇬🇧 EN  | **PortSwigger** | Texto  | [Open](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-document-write-sink-inside-select-element) |

## Resources by skill

| Skill                       | Source      | Link                                                                                       |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| Cross-Site Scripting (XSS)  | HackTricks  | [Open](https://book.hacktricks.wiki/en/pentesting-web/xss-cross-site-scripting/index.html) |
| Cross-Site Scripting (XSS)  | PortSwigger | [Open](https://portswigger.net/web-security/cross-site-scripting)                          |
| Remote Code Execution (RCE) | HackTricks  | [Open](https://book.hacktricks.wiki/en/pentesting-web/command-injection.html)              |

## Related skills

[Cross-Site Scripting (XSS)](/en/skills/xss) · [Remote Code Execution (RCE)](/en/skills/rce)

***

## Comments & tips

Solved this lab a different way? Share it here — comments live in [GitHub Discussions](https://github.com/FFuson/HTB_Writeups/discussions).

<div className="rootea-giscus-wrap" data-giscus-term="lab:cross-site-scripting-dom-based-document-write-sink-inside-select-element" data-giscus-lang="en" />

*Last updated: 2026-05-08*

<script type="application/ld+json">
  {`{"@context":"https://schema.org","@type":"TechArticle","name":"DOM XSS in document.write sink using source location.search inside a select element","headline":"DOM XSS in document.write sink using source location.search inside a select element — PortSwigger lab index","url":"https://rootea.es/en/portswigger/labs/cross-site-scripting/dom-based-document-write-sink-inside-select-element","inLanguage":"en","about":[{"@type":"Thing","name":"PortSwigger Web Security Academy"},{"@type":"Thing","name":"Cross-Site Scripting (XSS)"}],"isPartOf":{"@type":"WebSite","name":"rootea.es","url":"https://rootea.es"},"author":{"@type":"Organization","name":"rootea.es"}}`}
</script>
