Add advisory for quick-xml: quadratic attribute duplicate-check (CPU DoS)#3020
Merged
djc merged 1 commit intoJul 2, 2026
Merged
Conversation
…DoS) quick-xml < 0.41.0: the default duplicate-attribute-name check in the `Attributes` iterator scanned all previously seen names for every attribute, so a start tag with N distinct names cost O(N^2) byte comparisons -- a remote, unauthenticated CPU-exhaustion DoS on untrusted XML. Fixed in 0.41.0 (tafia/quick-xml#971). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
djc
approved these changes
Jul 2, 2026
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a RustSec advisory for quick-xml#969.
quick-xml< 0.41.00.41.0(released 2026-06-29)The default
with_checks(true)attribute iterator —BytesStart::attributes()/try_get_attribute, also reached internally byNsReader— checked each attribute name against every previously seen name with a linear scan, so a single start tag withNdistinct attribute names costO(N²)byte comparisons (measured, release: 80k ≈ 6 s, 800k ≈ 10 min). On untrusted XML this is a CPU-exhaustion denial of service; because the check is pure computation with no I/O, a consumer's read/request timeout cannot interrupt it. Fixed in 0.41.0 (tafia/quick-xml#971).Reported by me; the
quick-xmlmaintainer asked that I file the RustSec advisory. The ID is left as theRUSTSEC-0000-0000placeholder for assignment.🤖 Generated with Claude Code