# Server Side XSS \(Dynamic PDF\) ## Server Side XSS \(Dynamic PDF\) If a web page is creating a PDF using user controlled input, you can try to **trick the bot** that is creating the PDF into **executing arbitrary JS code**. So, if the **PDF creator bot finds** some kind of **HTML** **tags**, it is going to **interpret** them, and you can **abuse** this behaviour to cause a **Server XSS**. Please, notice that the ` ``` ### Path disclosure ```markup ``` ### Load an external script The best conformable way to exploit this vulnerability is to abuse the vulnerability to make the bot load a script you control locally. Then, you will be able to change the payload locally and make the bot load it with the same code every time. ```markup ')"/> ``` ### Read local file ```markup ``` ```markup ``` ### Get external web page response as attachment \(metadata endpoints\) ```markup ``` ### Bot delay ```markup ``` ### Port Scan ```markup ``` ### [SSRF](../ssrf-server-side-request-forgery.md) This vulnerability can be transformed very easily in a SSRF \(as you can make the script load external resources\). So just try to exploit it \(read some metadata?\). ## References {% embed url="https://lbherrera.github.io/lab/h1415-ctf-writeup.html" %} {% embed url="https://buer.haus/2017/06/29/escalating-xss-in-phantomjs-image-rendering-to-ssrflocal-file-read/" %} {% embed url="https://www.noob.ninja/2017/11/local-file-read-via-xss-in-dynamically.html" %}