Member-only story
XML External Entity (XXE) Injection in Web App Penetration Testing | 2023
In this section, we’ll explain what XML external entity injection is, describe some common examples, explain how to find and exploit various kinds of XXE injection, and summarize how to prevent XXE injection attacks | Karthikeyan Nagaraj

What is XXE Injection?
XML External Entity (XXE) Injection is a type of security vulnerability that occurs when an application parses XML input from an untrusted source. It enables an attacker to exploit an XML parser’s processing of external entities and can lead to disclosure of confidential data, denial of service, server-side request forgery, and even remote code execution.
XML external entity injection (also known as XXE) is a web security vulnerability that allows an attacker to interfere with an application’s processing of XML data. It often allows an attacker to view files on the application server filesystem, and to interact with any back-end or external systems that the application itself can access.
In some situations, an attacker can escalate an XXE attack to compromise the underlying server or other back-end infrastructure, by leveraging the XXE vulnerability to perform server-side request forgery (SSRF) attacks.
How do XXE vulnerabilities arise?
Some applications use the XML format to transmit data between the browser and the server. Applications that do this virtually always use a standard library or platform API to process the XML data on the server. XXE vulnerabilities arise because the XML specification contains various potentially dangerous features, and standard parsers support these features even if they are not normally used by the application.
Understanding the Anatomy of XXE Attacks
1. The XML Parsing Process
XML documents are commonly used to structure data in a hierarchical format. During parsing, an XML parser interprets the content and processes entities — placeholders that represent data.