resolve_entities=True enables entity resolution. The filter checks only for the exact bytes <!DOCTYPE and a single encoded string — it is insufficient.
Proof of Concept (PoC)
Goal: Read /app/flag.txt and have the content reflected in the XML response.
Why this works: lxml will expand declared entities when resolve_entities=True. The app reflects the <weight> / <height> values in the response XML, so injecting &xxe; into <weight> will cause the file content to appear in the returned XML.
Example payload (bypass simple filter)
Note: The filter checks for the exact bytes <!DOCTYPE, so using case variation like or adding whitespace/line breaks will evade it.