The vulnerability in question is XML External Entity (XXE) injection, which occurs when an application processes XML input containing external entities that access files on the server or external resources.
Disabling External Entities:
The root cause of the issue is the application's ability to process external entities (). Disabling external entities entirely prevents XXE attacks.
This can be achieved by properly configuring the XML parser (e.g., in Java, disable DocumentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl ", true)).
Why Not Other Options?
A (chmod o-rwx): File permission hardening may reduce the impact of a successful attack but does not mitigate XXE at the parser level.
B (Review logs): Reviewing logs is a reactive measure, not a prevention mechanism.
D (WAF): A WAF may block some malicious requests but is not a reliable mitigation for XXE vulnerabilities embedded in legitimate XML input.
CompTIA Pentest+ References:
Domain 3.0 (Attacks and Exploits)
OWASP XXE Prevention Cheat Sheet