💷XML External Entity Injection (XXE)
----------------------------------------------------------------
How to Detect and Exploit Them?
XML (Extensible Markup Language) is a popular data format that is used for web services (SOAP, REST), documents (XML, HTML, DOCX), images (svg, exif data) etc. Applications need a XML parser or XML processor to interpret XML data. XXE vulnerability arises when the XML parser interprets malicious payload as a standard XML data which can end up accessing or extracting sensitive data on the server.
To give an example, a basic HTTP request with XML body and the corresponding HTTP response looks like the following:

When the attacker sends the following XML data with the XXE payload included, the XML parser processes external entities which ends up the server returning the contents of the internal file /etc/passwd.

Cheatsheet
Last updated