An application allows users to upload XML files for processing. A tester uploads the following payload: <?xml version="1.0"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><root>&xxe;</root>. The server returns the contents of /etc/passwd. Which attack is being performed?
XML External Entity (XXE) injection is the correct vulnerability because the provided payload explicitly defines an external entity within the DOCTYPE declaration. By referencing "file:///etc/passwd" via the SYSTEM identifier, the XML parser is instructed to retrieve the content of the specified local file. This content is then processed and potentially returned in the application's response, confirming the successful exploitation of the XML parser's ability to resolve external entities.
Why this answer
This is an XML External Entity (XXE) injection attack, where an external entity is defined to read a local file. The server's XML parser processes the entity and reflects the file content, confirming the vulnerability.