👉 XML infection, or XML injection, is a type of security vulnerability that occurs when untrusted data is improperly handled within an XML processing environment, such as an XML parser or processor. Attackers exploit this by injecting malicious XML code into input data, which the system then interprets and executes as part of its own XML structure. This can lead to unauthorized access to sensitive data, execution of arbitrary code, or even complete compromise of the system. Unlike SQL injection, which targets databases, XML injection leverages the parsing and manipulation of XML documents, making it a potent threat in web applications that use XML for data exchange or configuration. Preventing XML infection involves validating and sanitizing input data, using secure parsing libraries, and avoiding dynamic XML construction from untrusted sources.