XML parsing is set to load external entities
What it finds
LIBXML_NOENT and libxml_disable_entity_loader(false): substituting external entities lets an XML document make the parser read local files or fetch URLs and put their contents into the result. Documents from outside should be parsed without it.
From the rule's source, xml_external_entities.rs.
<?phpfunction parse($xml){ $doc = new DOMDocument(); $doc->loadXML($xml, LIBXML_NOENT | LIBXML_DTDLOAD);tx0 reports: LIBXML_NOENT substitutes external entities libxml_disable_entity_loader(false);tx0 reports: this turns the loading of external entities on return simplexml_load_string($xml);} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/php:xml-external-entities" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:xml-external-entities] reason="..."tx0 explain tx0/php:xml-external-entities shows the same in the terminal. Found a false positive? Report it.