{"id":"DHI-5sov-dxuz-izqw-ojbm","aliases":["RUSTSEC-2026-0194"],"status":"published","title":"`BytesStart::attributes()` returns an `Attributes` iterator which, by default","description":"`BytesStart::attributes()` returns an `Attributes` iterator which, by default\n(`with_checks(true)`), rejects a start tag that repeats an attribute name. For\neach attribute yielded, the iterator compared the new name against every name\nseen so far in the same tag using a linear scan, so a start tag with `N`\ndistinct attribute names cost `O(N²)` byte comparisons. There was no bound on\n`N` other than the size of the buffered start tag.\n\n## Impact\n\nAny code that parses untrusted XML and iterates a start tag's attributes with\nthe default duplicate check enabled can be made to spend CPU time quadratic in\nthe number of attributes on a single tag. Because the check is pure computation\nwith no `.await`/I/O, an I/O-based timeout on the consumer (for example a read\nor request timeout) cannot interrupt it while it runs.\n\nMeasured cost of a single start tag, release build:\n\n| Attributes on one tag | Time |\n|---|---|\n| 80,000  | ~6 s   |\n| 800,000 | ~10 min |\n\nThe cost grows with the square of the attribute count, so a start tag of a few\ntens of megabytes can stall a parsing thread for hours. No memory is exhausted\nand the parser does not crash; the effect is CPU exhaustion on the thread doing\nthe parsing: a single crafted start tag can pin a CPU core for minutes to hours,\ndenying service to that worker. A deployment that places a wall-clock bound on\nparsing, or confines it to a non-critical thread, may consider the availability\nimpact lower.\n\n## Affected code paths\n\n* `BytesStart::attributes()` / `Attributes` iterated with checks enabled (the\n  default), and `BytesStart::try_get_attribute`.\n* `NsReader`, which resolves namespaces by iterating a tag's attributes and so\n  reaches the same check internally.\n\nConsumers that iterate attributes with `.attributes().with_checks(false)` and do\nnot use `NsReader` are not affected.\n\nThis was reported as reachable by a remote, unauthenticated attacker in a\nreal-world RPKI relying party (NLnet Labs Routinator) via a crafted RRDP\n`snapshot.xml`.\n\n## Remediation\n\nUpgrade to `quick-xml \u003e= 0.41.0`, where the duplicate check keeps the linear\nscan for start tags with a small number of attributes and switches to an `O(1)`\nhash pre-filter above a threshold, making the whole tag `O(N)`. The reported\n`AttrError::Duplicated` positions are unchanged.\n\nIf upgrading is not possible and duplicate-name detection is not required,\ndisable it with `.attributes().with_checks(false)` (this does not help\n`NsReader` consumers, which have no equivalent opt-out before 0.41.0).","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:19Z","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-5sov-dxuz-izqw-ojbm","tags":["advisory"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0194","tags":["advisory"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0194.html","tags":["advisory"]},{"url":"https://github.com/tafia/quick-xml/pull/971","tags":["fix","web"]},{"url":"https://github.com/tafia/quick-xml/commit/07f3db8343cf152f5bc3483ef5b3164582489bea","tags":["fix","web"]},{"url":"https://github.com/tafia/quick-xml/issues/969","tags":["web","report"]},{"url":"https://crates.io/crates/quick-xml","tags":["package"]}],"sources":{"osv":[{"id":"DHI-5sov-dxuz-izqw-ojbm","title":"`BytesStart::attributes()` returns an `Attributes` iterator which, by default","description":"`BytesStart::attributes()` returns an `Attributes` iterator which, by default\n(`with_checks(true)`), rejects a start tag that repeats an attribute name. For\neach attribute yielded, the iterator compared the new name against every name\nseen so far in the same tag using a linear scan, so a start tag with `N`\ndistinct attribute names cost `O(N²)` byte comparisons. There was no bound on\n`N` other than the size of the buffered start tag.\n\n## Impact\n\nAny code that parses untrusted XML and iterates a start tag's attributes with\nthe default duplicate check enabled can be made to spend CPU time quadratic in\nthe number of attributes on a single tag. Because the check is pure computation\nwith no `.await`/I/O, an I/O-based timeout on the consumer (for example a read\nor request timeout) cannot interrupt it while it runs.\n\nMeasured cost of a single start tag, release build:\n\n| Attributes on one tag | Time |\n|---|---|\n| 80,000  | ~6 s   |\n| 800,000 | ~10 min |\n\nThe cost grows with the square of the attribute count, so a start tag of a few\ntens of megabytes can stall a parsing thread for hours. No memory is exhausted\nand the parser does not crash; the effect is CPU exhaustion on the thread doing\nthe parsing: a single crafted start tag can pin a CPU core for minutes to hours,\ndenying service to that worker. A deployment that places a wall-clock bound on\nparsing, or confines it to a non-critical thread, may consider the availability\nimpact lower.\n\n## Affected code paths\n\n* `BytesStart::attributes()` / `Attributes` iterated with checks enabled (the\n  default), and `BytesStart::try_get_attribute`.\n* `NsReader`, which resolves namespaces by iterating a tag's attributes and so\n  reaches the same check internally.\n\nConsumers that iterate attributes with `.attributes().with_checks(false)` and do\nnot use `NsReader` are not affected.\n\nThis was reported as reachable by a remote, unauthenticated attacker in a\nreal-world RPKI relying party (NLnet Labs Routinator) via a crafted RRDP\n`snapshot.xml`.\n\n## Remediation\n\nUpgrade to `quick-xml \u003e= 0.41.0`, where the duplicate check keeps the linear\nscan for start tags with a small number of attributes and switches to an `O(1)`\nhash pre-filter above a threshold, making the whole tag `O(N)`. The reported\n`AttrError::Duplicated` positions are unchanged.\n\nIf upgrading is not possible and duplicate-name detection is not required,\ndisable it with `.attributes().with_checks(false)` (this does not help\n`NsReader` consumers, which have no equivalent opt-out before 0.41.0).","status":"published","published":"2026-11-13T16:59:06Z","modified":"2026-11-16T02:34:19.118851652Z","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:09:00.349364Z"},{"id":"RUSTSEC-2026-0194","title":"Quadratic run time when checking a start tag for duplicate attribute names","description":"`BytesStart::attributes()` returns an `Attributes` iterator which, by default\n(`with_checks(true)`), rejects a start tag that repeats an attribute name. For\neach attribute yielded, the iterator compared the new name against every name\nseen so far in the same tag using a linear scan, so a start tag with `N`\ndistinct attribute names cost `O(N²)` byte comparisons. There was no bound on\n`N` other than the size of the buffered start tag.\n\n## Impact\n\nAny code that parses untrusted XML and iterates a start tag's attributes with\nthe default duplicate check enabled can be made to spend CPU time quadratic in\nthe number of attributes on a single tag. Because the check is pure computation\nwith no `.await`/I/O, an I/O-based timeout on the consumer (for example a read\nor request timeout) cannot interrupt it while it runs.\n\nMeasured cost of a single start tag, release build:\n\n| Attributes on one tag | Time |\n|---|---|\n| 80,000  | ~6 s   |\n| 800,000 | ~10 min |\n\nThe cost grows with the square of the attribute count, so a start tag of a few\ntens of megabytes can stall a parsing thread for hours. No memory is exhausted\nand the parser does not crash; the effect is CPU exhaustion on the thread doing\nthe parsing: a single crafted start tag can pin a CPU core for minutes to hours,\ndenying service to that worker. A deployment that places a wall-clock bound on\nparsing, or confines it to a non-critical thread, may consider the availability\nimpact lower.\n\n## Affected code paths\n\n* `BytesStart::attributes()` / `Attributes` iterated with checks enabled (the\n  default), and `BytesStart::try_get_attribute`.\n* `NsReader`, which resolves namespaces by iterating a tag's attributes and so\n  reaches the same check internally.\n\nConsumers that iterate attributes with `.attributes().with_checks(false)` and do\nnot use `NsReader` are not affected.\n\nThis was reported as reachable by a remote, unauthenticated attacker in a\nreal-world RPKI relying party (NLnet Labs Routinator) via a crafted RRDP\n`snapshot.xml`.\n\n## Remediation\n\nUpgrade to `quick-xml \u003e= 0.41.0`, where the duplicate check keeps the linear\nscan for start tags with a small number of attributes and switches to an `O(1)`\nhash pre-filter above a threshold, making the whole tag `O(N)`. The reported\n`AttrError::Duplicated` positions are unchanged.\n\nIf upgrading is not possible and duplicate-name detection is not required,\ndisable it with `.attributes().with_checks(false)` (this does not help\n`NsReader` consumers, which have no equivalent opt-out before 0.41.0).","status":"published","published":"2026-06-29T12:00:00Z","modified":"2026-07-02T08:00:03.849273679Z","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"}]}}
