# RUSTSEC-2026-0194: Quadratic run time when checking a start tag for duplicate attribute names

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-06-29T12:00:00.000Z
- **Modified:** 2026-07-02T08:00:03.849Z

## Who should check

- Projects that depend on crates.io package quick-xml (\>= 0.0.0-0, \< 0.41.0)

## Description

\`BytesStart::attributes()\` returns an \`Attributes\` iterator which, by default
(\`with\_checks(true)\`), rejects a start tag that repeats an attribute name. For
each attribute yielded, the iterator compared the new name against every name
seen so far in the same tag using a linear scan, so a start tag with \`N\`
distinct attribute names cost \`O(N²)\` byte comparisons. There was no bound on
\`N\` other than the size of the buffered start tag.

\#\# Impact

Any code that parses untrusted XML and iterates a start tag's attributes with
the default duplicate check enabled can be made to spend CPU time quadratic in
the number of attributes on a single tag. Because the check is pure computation
with no \`.await\`/I/O, an I/O-based timeout on the consumer (for example a read
or request timeout) cannot interrupt it while it runs.

Measured cost of a single start tag, release build:

\| Attributes on one tag \| Time \|
\|---\|---\|
\| 80,000  \| ~6 s   \|
\| 800,000 \| ~10 min \|

The cost grows with the square of the attribute count, so a start tag of a few
tens of megabytes can stall a parsing thread for hours. No memory is exhausted
and the parser does not crash; the effect is CPU exhaustion on the thread doing
the parsing: a single crafted start tag can pin a CPU core for minutes to hours,
denying service to that worker. A deployment that places a wall-clock bound on
parsing, or confines it to a non-critical thread, may consider the availability
impact lower.

\#\# Affected code paths

\* \`BytesStart::attributes()\` / \`Attributes\` iterated with checks enabled (the
  default), and \`BytesStart::try\_get\_attribute\`.
\* \`NsReader\`, which resolves namespaces by iterating a tag's attributes and so
  reaches the same check internally.

Consumers that iterate attributes with \`.attributes().with\_checks(false)\` and do
not use \`NsReader\` are not affected.

This was reported as reachable by a remote, unauthenticated attacker in a
real-world RPKI relying party (NLnet Labs Routinator) via a crafted RRDP
\`snapshot.xml\`.

\#\# Remediation

Upgrade to \`quick-xml \>= 0.41.0\`, where the duplicate check keeps the linear
scan for start tags with a small number of attributes and switches to an \`O(1)\`
hash pre-filter above a threshold, making the whole tag \`O(N)\`. The reported
\`AttrError::Duplicated\` positions are unchanged.

If upgrading is not possible and duplicate-name detection is not required,
disable it with \`.attributes().with\_checks(false)\` (this does not help
\`NsReader\` consumers, which have no equivalent opt-out before 0.41.0).

## Affected and fixed versions

- crates.io `quick-xml`: affected \>= 0.0.0-0, \< 0.41.0; fixed 0.41.0 (osv)

## Mitigation

- Upgrade quick-xml to 0.41.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by RUSTSEC-2026-0194. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/RUSTSEC-2026-0194.md
Affected: quick-xml >= 0.0.0-0, < 0.41.0
Fixed in: 0.41.0

Steps:
1. Search this machine and project for quick-xml (crates.io): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is RUSTSEC-2026-0194 being exploited?

There is no confirmed exploitation: RUSTSEC-2026-0194 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is RUSTSEC-2026-0194?

It has no CVSS score yet. Unknown.

### Which versions are affected by RUSTSEC-2026-0194?

quick-xml \>= 0.0.0-0, \< 0.41.0.

### Is there a fix for RUSTSEC-2026-0194?

Yes. Fixed in 0.41.0. Upgrade quick-xml to 0.41.0 or later.

### How do I check if I'm affected by RUSTSEC-2026-0194?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://rustsec.org/advisories/RUSTSEC-2026-0194.html>
- patch: <https://github.com/tafia/quick-xml/pull/971>
- patch: <https://github.com/tafia/quick-xml/commit/07f3db8343cf152f5bc3483ef5b3164582489bea>
- other: <https://crates.io/crates/quick-xml>
- other: <https://github.com/tafia/quick-xml/issues/969>

## Attribution

- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/RUSTSEC-2026-0194> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/RUSTSEC-2026-0194> · JSON: <https://flawdb.com/api/v1/entries/RUSTSEC-2026-0194>
