diff --git a/crates/xfa/README.md b/crates/xfa/README.md index e4ed85e08..a3548c2d1 100644 --- a/crates/xfa/README.md +++ b/crates/xfa/README.md @@ -7,3 +7,5 @@ Preserves source byte ranges, coalesced text, namespace shadowing and document-l Original source by Dylan M. Taylor (eead4541, 7d44e654), MIT OR Apache-2.0. Compatibility delta versus the original app XML pin e2dc681a3: current strict craft-xml rejects duplicate raw or expanded attribute names. This deliberately preserves shared security hardening; valid-document DOM behavior is unchanged, but malformed acceptance and errors are not promised byte-identical. Regression tests cover both duplicate forms. + +The updated strict reader also bounds aggregate active namespace declarations to 1024 across ancestor elements, not just attributes per tag. The old app path could accept more inherited declarations. The exact boundary and one-over case are tested; this intentional tighter resource admission is retained. diff --git a/crates/xfa/src/xml.rs b/crates/xfa/src/xml.rs index 0840170e6..2f4a49db8 100644 --- a/crates/xfa/src/xml.rs +++ b/crates/xfa/src/xml.rs @@ -411,6 +411,23 @@ mod tests { assert_eq!(root.range(), 0..text.len()); } + #[test] + fn inherited_namespace_declarations_have_an_aggregate_budget() { + use std::fmt::Write; + let mut xml = String::from(""); + assert!(Document::parse(&accepted).is_ok()); + let rejected = format!("{xml} xmlns:extra='extra'/>"); + assert!(Document::parse(&rejected).is_err()); + } + #[test] fn malformed_dtd_and_resource_limits_are_preserved() { // Current shared XML rejects duplicate attributes, unlike the older app pin.