# [Exploitation/Web] XSLT ## Introduction La vulnérabilité **XSLT** (Extensible Stylesheet Language Transformations) survient lorsqu’un moteur de transformation XML mal sécurisé permet à un attaquant d’injecter ou d’exécuter du code XSLT arbitraire, pouvant mener à l’exfiltration de données, l'exécution de commandes ou l'accès non autorisé au système.  ## Sources - [https://www.acunetix.com/blog/articles/the-hidden-dangers-of-xsltprocessor-remote-xsl-injection/](https://www.acunetix.com/blog/articles/the-hidden-dangers-of-xsltprocessor-remote-xsl-injection/) - [https://www.php.net/manual/fr/xsltprocessor.transformtoxml.php](https://www.php.net/manual/fr/xsltprocessor.transformtoxml.php) ## Cheat-sheet Admettons le code suivant pour la page web vulnérable : ```php load('collection.xml'); $xml = nex DOMDocument; $xml->load($_GET['xsl']); // Configure the transformer $proc = new XSLTProcessor; $proc->registerPHPFunctions(); $proc->importStyleSheet($xml); echo $proc->transformToXML($xml); ?> ```
Ici, le paramètre xsl est passé via la méthode **GET** mais dans votre cas il pourrait s'agir d'un paramètre **POST** ou même d'un paramètre passé via le **User-Agent**.
#### XSS ```xml