Question 1
Topic: XML External Entity attack
Skill tested: Configures XML parsing to prevent external entity resolution and XXE data disclosure.
A claims-processing service accepts XML documents from partner organizations and parses them using a server-side XML library. A security review finds that a document can cause the service to read a local file through an external entity. The service must continue accepting valid XML, and partner documents do not require external DTDs or entity expansion. The development team wants a fix that addresses the parsing root cause rather than relying on network filtering or input-pattern detection. Which change is MOST appropriate?
Disabling DTD processing and external entity resolution prevents the parser from retrieving external resources, which addresses the cause of XXE while preserving ordinary XML parsing. Pattern blacklists can be bypassed through alternate syntax or encoding. Read-only permissions still allow sensitive files to be disclosed, and escaping the entire input can corrupt legitimate XML without reliably changing parser behavior.