XML Injection
XXE to retrieve files
For example, suppose a shopping application checks for the stock level of a product by submitting the following XML to the server:
The application performs no particular defenses against XXE attacks, so you can exploit the XXE vulnerability to retrieve the /etc/passwd
file by submitting the following XXE payload:
This XXE payload defines an external entity &xxe;
whose value is the contents of the /etc/passwd
file and uses the entity within the productId
value. This causes the application's response to include the contents of the file:
XXE to perform SSRF attacks
XInclude attacks
XXE attacks via modified content type
For example, if a normal request contains the following:
Then you might be able submit the following request, with the same result:
Last updated