Bump dom4j to 2.1.5 and keep SAXReader from bypassing Commons Secure XML - #109
Merged
Merged
Conversation
2.1.5 is the last dom4j release that runs on Java 8; 2.2.0 requires Java 11. dom4j 2.x drops the untyped `Stylesheet.run(Object)` and `applyTemplates(Object, ...)` overloads, so the JSL tag library now dispatches on the runtime type of its XPath context itself. The xmlunit and jaxme modules used the released commons-jelly-tags-xml 1.1 as a test dependency, whose POM drags in dom4j:dom4j 1.5 and the XPP pull parser. The old coordinates are no longer overridden by the new ones and the XPP JAXP factory rejects secure processing, so both modules now depend on the in-tree 1.2-SNAPSHOT like the other tag libraries. Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
Unless an EntityResolver is set explicitly, `SAXReader.read` installs its own resolver, which resolves every external entity to an InputSource carrying only its system ID. The parser then fetches that system ID, which defeats the ignore-all resolver floor that Commons Secure XML installs on the XMLReader we hand to dom4j. Every SAXReader created by the xml and xmlunit tag libraries now gets a resolver that resolves nothing, so each lookup falls through to that floor. The three identical factory methods of the xmlunit tags move to a shared helper in XMLUnitTagSupport. Both modules gain a regression test that parses a document whose DOCTYPE points to a DTD that does not exist. Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
|
Thank you @ppkarwasz , merged 🚀 |
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.
Two commits:
Bump dom4j:dom4j 1.6.1 to org.dom4j:dom4j 2.1.5, the last dom4j release that runs on Java 8 (2.2.0 requires Java 11).
Keep dom4j
SAXReaderfrom bypassing Commons Secure XML. Unless anEntityResolveris set explicitly,SAXReader.readinstalls its own resolver, which resolves every external entity to anInputSourcecarrying only its system ID.Not addressed here:
<xu:assertDocumentsEqual>feeds the documents' XML text into XMLUnit'sDiff, which re-parses it with XMLUnit's own JAXP parser, so a DOCTYPE still triggers an external fetch on that path.🤖 Generated with Claude Code