{"id":"DHI-4nnk-mlle-pzj6-hzdj","aliases":["RUSTSEC-2026-0195"],"status":"published","title":"`NsReader` resolves namespaces by calling `NamespaceResolver::push` for every","description":"`NsReader` resolves namespaces by calling `NamespaceResolver::push` for every\n`Start`/`Empty` event *before* the event is returned to the caller. `push`\niterated all `xmlns` / `xmlns:*` attributes on the start tag and, for each one,\nappended the prefix bytes to an internal buffer and pushed a `NamespaceBinding`\n(32 bytes on 64-bit) to an internal `Vec`, with no upper bound on the number of\ndeclarations.\n\n## Impact\n\nA start tag with `N` namespace declarations drove roughly `3×` the tag's byte\nsize in `NamespaceResolver` heap, allocated *inside* `quick-xml` before the\n`NsReader` consumer ever received the event and could inspect or reject it. A\nconsumer that bounds its *input* size therefore still cannot bound this\nallocation: an `M`-byte start tag yields on the order of `3 × M` bytes of\nresolver heap the caller never sees.\n\nOn untrusted XML this lets a remote, unauthenticated attacker force large heap\nallocations with a single start tag. With several `NsReader`s running\nconcurrently on independent inputs (a common server pattern), the allocations\nstack and can exhaust process memory, causing the operating system to kill the\nprocess (OOM). This was confirmed against a real-world RPKI relying party (NLnet\nLabs Routinator), where concurrent RRDP validation workers parsing a crafted\n`snapshot.xml` exceeded the memory limit and the process was OOM-killed.\n\n## Affected code paths\n\nConsumers using `NsReader` (which always calls `NamespaceResolver::push` before\nyielding `Start`/`Empty`), or calling `NamespaceResolver::push` directly. A plain\n`Reader` that does not perform namespace resolution is not affected.\n\n## Remediation\n\nUpgrade to `quick-xml \u003e= 0.41.0`. `NamespaceResolver::push` now rejects a start\ntag that declares more than `DEFAULT_MAX_DECLARATIONS_PER_ELEMENT` (256)\nnamespace bindings, returning the new `NamespaceError::TooManyDeclarations`\ninstead of allocating without limit. The limit is configurable via\n`NamespaceResolver::set_max_declarations_per_element` (use `usize::MAX` to\nrestore the previous unbounded behavior), and `NsReader::resolver_mut()` is\nprovided to reach it.\n\nThere is no clean workaround for `NsReader` consumers before 0.41.0, as the\nallocation happens inside the reader with no configuration knob to cap it.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","from":"osv"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2026-06-29T12:00:00Z","modified":"2026-11-16T02:34:09Z","fixes":[{"ecosystem":"crates.io","package":"quick-xml","fixed_in":["0.41.0"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"gitlab-rails-18","versions":["18.11.11-r0","18.11.11-r1","18.11.11-r2","18.11.12-r0","18.11.12-r1","18.11.12-r2","18.11.12-r3","18.11.12-r4","18.11.14-r0","18.11.14-r1","18.11.14-r10","18.11.14-r11","18.11.14-r2","18.11.14-r3","18.11.14-r4","18.11.14-r5","18.11.14-r6","18.11.14-r7","18.11.14-r8","18.11.14-r9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"gitlab-rails-19","versions":["19.1.8-r0","19.1.8-r1","19.4.1-r0","19.4.1-r1","19.4.1-r2","19.4.1-r3","19.4.2-r0","19.5.3-r0","19.5.3-r1","19.5.3-r2","19.5.3-r3","19.5.3-r4","19.5.3-r5","19.5.3-r6","19.5.3-r7","19.5.3-r8","19.5.4-r0","19.5.4-r1","19.5.5-r0","19.5.5-r1","19.5.5-r2"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"rust","versions":["1.91.1-r0","1.91.1-r2","1.91.1-r3","1.91.1-r4","1.93.1-r0","1.93.1-r1","1.94.0-r0","1.94.0-r1","1.94.1-r0","1.94.1-r1","1.95.0-r0","1.96.0-r0","1.96.1-r0","1.97.0-r0","1.97.0-r1","1.98.1-r0","1.99.0-r2","1.99.1-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"gitlab-rails-18","versions":["18.11.11-0","18.11.11-1","18.11.11-2","18.11.12-0","18.11.12-1","18.11.12-2","18.11.14-0","18.11.14-1","18.11.14-10","18.11.14-11","18.11.14-12","18.11.14-13","18.11.14-14","18.11.14-15","18.11.14-16","18.11.14-17","18.11.14-2","18.11.14-3","18.11.14-4","18.11.14-5","18.11.14-6","18.11.14-7","18.11.14-8","18.11.14-9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"gitlab-rails-19","versions":["19.1.8-0","19.1.8-1","19.4.1-0","19.4.1-1","19.4.1-2","19.4.2-0","19.5.3-0","19.5.3-1","19.5.3-2","19.5.3-3","19.5.3-4","19.5.3-5","19.5.3-6","19.5.3-7","19.5.3-8","19.5.3-9","19.5.4-0","19.5.4-1","19.5.5-0","19.5.5-1","19.5.5-2","19.5.5-3","19.5.5-4","19.5.5-5","19.5.5-6","19.5.5-7"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-fips-libs","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-fips","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-libs","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"miniconda3-26","versions":["26.7.1-1-0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"vector","versions":["0.58.0-0","0.59.0-0","0.60.0-0","0.61.0-0"]},{"source":"osv","ecosystem":"crates.io","package":"quick-xml","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.41.0"}]}]}],"references":[{"url":"https://scout.docker.com/v/DHI-4nnk-mlle-pzj6-hzdj","tags":["advisory"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0195","tags":["advisory"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0195.html","tags":["advisory"]},{"url":"https://github.com/tafia/quick-xml/commit/7ca25266e94987210daa864889ab15c9332c8a2a","tags":["fix","web"]},{"url":"https://github.com/tafia/quick-xml/issues/970","tags":["web","report"]},{"url":"https://crates.io/crates/quick-xml","tags":["package"]}],"sources":{"osv":[{"id":"DHI-4nnk-mlle-pzj6-hzdj","title":"`NsReader` resolves namespaces by calling `NamespaceResolver::push` for every","description":"`NsReader` resolves namespaces by calling `NamespaceResolver::push` for every\n`Start`/`Empty` event *before* the event is returned to the caller. `push`\niterated all `xmlns` / `xmlns:*` attributes on the start tag and, for each one,\nappended the prefix bytes to an internal buffer and pushed a `NamespaceBinding`\n(32 bytes on 64-bit) to an internal `Vec`, with no upper bound on the number of\ndeclarations.\n\n## Impact\n\nA start tag with `N` namespace declarations drove roughly `3×` the tag's byte\nsize in `NamespaceResolver` heap, allocated *inside* `quick-xml` before the\n`NsReader` consumer ever received the event and could inspect or reject it. A\nconsumer that bounds its *input* size therefore still cannot bound this\nallocation: an `M`-byte start tag yields on the order of `3 × M` bytes of\nresolver heap the caller never sees.\n\nOn untrusted XML this lets a remote, unauthenticated attacker force large heap\nallocations with a single start tag. With several `NsReader`s running\nconcurrently on independent inputs (a common server pattern), the allocations\nstack and can exhaust process memory, causing the operating system to kill the\nprocess (OOM). This was confirmed against a real-world RPKI relying party (NLnet\nLabs Routinator), where concurrent RRDP validation workers parsing a crafted\n`snapshot.xml` exceeded the memory limit and the process was OOM-killed.\n\n## Affected code paths\n\nConsumers using `NsReader` (which always calls `NamespaceResolver::push` before\nyielding `Start`/`Empty`), or calling `NamespaceResolver::push` directly. A plain\n`Reader` that does not perform namespace resolution is not affected.\n\n## Remediation\n\nUpgrade to `quick-xml \u003e= 0.41.0`. `NamespaceResolver::push` now rejects a start\ntag that declares more than `DEFAULT_MAX_DECLARATIONS_PER_ELEMENT` (256)\nnamespace bindings, returning the new `NamespaceError::TooManyDeclarations`\ninstead of allocating without limit. The limit is configurable via\n`NamespaceResolver::set_max_declarations_per_element` (use `usize::MAX` to\nrestore the previous unbounded behavior), and `NsReader::resolver_mut()` is\nprovided to reach it.\n\nThere is no clean workaround for `NsReader` consumers before 0.41.0, as the\nallocation happens inside the reader with no configuration knob to cap it.","status":"published","published":"2026-11-13T16:59:06Z","modified":"2026-11-16T02:34:09.647772095Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-16T03:08:59.598406Z"},{"id":"RUSTSEC-2026-0195","title":"Unbounded namespace-declaration allocation in `NsReader` enables memory-exhaustion denial of service","description":"`NsReader` resolves namespaces by calling `NamespaceResolver::push` for every\n`Start`/`Empty` event *before* the event is returned to the caller. `push`\niterated all `xmlns` / `xmlns:*` attributes on the start tag and, for each one,\nappended the prefix bytes to an internal buffer and pushed a `NamespaceBinding`\n(32 bytes on 64-bit) to an internal `Vec`, with no upper bound on the number of\ndeclarations.\n\n## Impact\n\nA start tag with `N` namespace declarations drove roughly `3×` the tag's byte\nsize in `NamespaceResolver` heap, allocated *inside* `quick-xml` before the\n`NsReader` consumer ever received the event and could inspect or reject it. A\nconsumer that bounds its *input* size therefore still cannot bound this\nallocation: an `M`-byte start tag yields on the order of `3 × M` bytes of\nresolver heap the caller never sees.\n\nOn untrusted XML this lets a remote, unauthenticated attacker force large heap\nallocations with a single start tag. With several `NsReader`s running\nconcurrently on independent inputs (a common server pattern), the allocations\nstack and can exhaust process memory, causing the operating system to kill the\nprocess (OOM). This was confirmed against a real-world RPKI relying party (NLnet\nLabs Routinator), where concurrent RRDP validation workers parsing a crafted\n`snapshot.xml` exceeded the memory limit and the process was OOM-killed.\n\n## Affected code paths\n\nConsumers using `NsReader` (which always calls `NamespaceResolver::push` before\nyielding `Start`/`Empty`), or calling `NamespaceResolver::push` directly. A plain\n`Reader` that does not perform namespace resolution is not affected.\n\n## Remediation\n\nUpgrade to `quick-xml \u003e= 0.41.0`. `NamespaceResolver::push` now rejects a start\ntag that declares more than `DEFAULT_MAX_DECLARATIONS_PER_ELEMENT` (256)\nnamespace bindings, returning the new `NamespaceError::TooManyDeclarations`\ninstead of allocating without limit. The limit is configurable via\n`NamespaceResolver::set_max_declarations_per_element` (use `usize::MAX` to\nrestore the previous unbounded behavior), and `NsReader::resolver_mut()` is\nprovided to reach it.\n\nThere is no clean workaround for `NsReader` consumers before 0.41.0, as the\nallocation happens inside the reader with no configuration knob to cap it.","status":"published","published":"2026-06-29T12:00:00Z","modified":"2026-07-02T09:00:04.037478193Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:53:40.430679Z"}]}}
