An XML reader is set to process DTDs, which can read files and exhaust memory

tx0/csharp:dtd-processing-enabledrecommendedwarningsecurity/injectiondepth fastsecurity, cwe-611

What it finds

With DTD processing on, an XML document can define entities that expand to the content of local files or remote URLs, or to billions of characters. DtdProcessing.Prohibit, the default of XmlReader.Create, rejects such documents. The settings checked are DtdProcessing = DtdProcessing.Parse and ProhibitDtd = false.

From the rule's source, dtd_processing_enabled.rs.

Example from the rule's tests
using System.Xml; class Xml{    XmlReaderSettings Make()    {        var settings = new XmlReaderSettings();        settings.DtdProcessing = DtdProcessing.Parse;tx0 reports: DTD processing is enabled for this XML reader        settings.DtdProcessing = DtdProcessing.Prohibit;        return settings;    }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

tx0.toml
[rules]
"tx0/csharp:dtd-processing-enabled" = "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/csharp:dtd-processing-enabled] reason="..."

tx0 explain tx0/csharp:dtd-processing-enabled shows the same in the terminal. Found a false positive? Report it.