{"id":"RUSTSEC-2026-0599","summary":"Stack overflow from unbounded recursion in DTD content-model parsing","details":"`xmloxide`'s DTD parser recursed without a depth bound when parsing the\nparenthesised content model of an `\u003c!ELEMENT\u003e` declaration. A small document\nwhose internal DTD subset contains many nested `(` drives unbounded mutual\nrecursion between `DtdParser::parse_content_particle` and\n`DtdParser::parse_content_spec_group`, exhausting the stack and aborting the\nprocess.\n\nThe internal DTD subset is parsed during ordinary document parsing, so this is\nreachable through the default parse entry points (for example\n`Document::parse_str`) on any input that carries a `DOCTYPE`. The existing\n`ParseOptions::max_depth` limit does not prevent it: it bounds element nesting,\nnot DTD content-model nesting. A stack overflow cannot be caught as an error,\nso any process that parses attacker-controlled XML with `xmloxide` can be\ncrashed with a small payload.\n\nFixed in 0.4.4: a parenthesis-nesting depth counter is threaded through the\ncontent-model parser, and nesting deeper than 256 levels is rejected with a\nnormal `ParseError`. Well-formed DTDs are unaffected.\n\nApplications that cannot upgrade should reject or strip the `DOCTYPE` from\nuntrusted input before parsing.","aliases":["CVE-2026-61727","GHSA-7jmw-29gc-ffx4"],"modified":"2026-11-24T22:00:02.131450524Z","published":"2026-07-20T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/xmloxide"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0599.html"},{"type":"WEB","url":"https://github.com/jonwiggins/xmloxide/commit/d606e11ddaf033272d85c5422addd91b79788aba"}],"affected":[{"package":{"name":"xmloxide","ecosystem":"crates.io","purl":"pkg:cargo/xmloxide"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.4.4"}]}],"ecosystem_specific":{"affects":{"os":[],"functions":[],"arch":[]},"affected_functions":null},"database_specific":{"informational":null,"categories":["denial-of-service"],"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0599.json","cvss":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}