mediumMultiple SelectObjective-mapped
CAS-004 Mitigations for XXE Practice Question
Which two of the following are effective mitigations against XML External Entity (XXE) injection attacks? (Select the two best options.)
⚠ Common exam trap
CompTIA often tests the misconception that input validation or schema validation alone can prevent injection attacks, but the trap here is that XXE exploits parser-level features (DTD processing) that occur before any schema validation or content filtering takes place.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Disable Document Type Definition (DTD) processing in the XML parser
XXE attacks exploit the XML parser's ability to process external entities defined in a DTD. By disabling DTD processing entirely, the parser cannot resolve or fetch external resources, which neutralizes the primary vector for XXE injection. This is a standard security hardening step for XML parsers like libxml2, Xerces, or .NET's XmlReader, often achieved by setting properties such as `LIBXML_NOENT` to false or `XmlReaderSettings.DtdProcessing` to `Prohibit`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a blacklist to filter out dangerous XML tags
Why it's wrong here
Blacklists are easily bypassed; disabling DTD is more robust.
- ✗
Validate all XML input against a schema
Why it's wrong here
Schema validation does not prevent XXE if DTDs are still enabled.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The CAS-005 exam frequently reuses these exact scenarios with slightly different constraints.
✓Disable Document Type Definition (DTD) processing in the XML parserCorrect answer▾
✗Use a blacklist to filter out dangerous XML tagsWrong answer — click to see why▾
Why this is wrong here
Blacklists are easily bypassed; disabling DTD is more robust.
✗Validate all XML input against a schemaWrong answer — click to see why▾
Why this is wrong here
Schema validation does not prevent XXE if DTDs are still enabled.
Analysis generated from the official CAS-005blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Visual reference
Go deeper
Related to this question
About these practice questions
This CAS-005 question is part of Courseiva's 968-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.