Skip to content

fix: bound InclusiveNamespaces PrefixList during exclusive c14n - #156

Merged
adamdecaf merged 1 commit into
masterfrom
fix-exc-c14n-prefixlist-limit
Oct 26, 2026
Merged

adamdecaf merged 1 commit into
masterfrom
fix-exc-c14n-prefixlist-limit

Conversation

@adamdecaf

Copy link
Copy Markdown
Member

Summary

v1.4.1 capped in-scope xmlns maps during exclusive canonicalization. It did not bound InclusiveNamespaces PrefixList. ValidateReferences() still split that attribute without a limit and walked every token at every element, so a long list of undeclared prefixes could stall workers before the digest check.

This scans PrefixList in place, keeps unique prefixes only, errors above 8192, and intersects that set with the already-capped namespace map instead of the raw token slice.

Reported privately by Naor Yaacov. Residual of CVE-2026-113729 / GHSA-5588-rp99-5fjh.

Testing

  • go test -count=1 ./...
  • make check
  • Regression through NewValidator + ValidateReferences(): 10k elements with 250k repeated PrefixList tokens now finish next to an equal-size single-token control, instead of ~500x slower. Unique prefixes above 8192 are refused.

🤖 grok

@adamdecaf
adamdecaf marked this pull request as ready for review October 26, 2026 19:58
v1.4.1 capped in-scope xmlns maps but still split PrefixList without a
limit and walked every token at every element. Scan the attribute in
place, cap unique prefixes at 8192, and intersect the set with in-scope
namespaces so cost follows the existing namespace bound.

Reported-by: Naor Yaacov
@adamdecaf
adamdecaf force-pushed the fix-exc-c14n-prefixlist-limit branch from 1d8e023 to 8a88a3f Compare October 26, 2026 20:02
@adamdecaf
adamdecaf merged commit fbadacf into master Oct 26, 2026
8 checks passed
@adamdecaf
adamdecaf deleted the fix-exc-c14n-prefixlist-limit branch October 26, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant