Repository navigation
Use commons-secure-xml for the XPath and DOM factories in core - #2257
Merged
Merged
Conversation
dpol1
approved these changes
Oct 23, 2026
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.
Hardening, no known issue behind it. Core now creates its JAXP factories through Apache Commons Secure XML (1.1.0, no runtime dependencies):
jsoup.XPathFilterandparse.filter.XPathFilteruseSecureXPathFactory.newDefaultInstance(). This pins the JDK's XPath implementation instead of whatever is registered on the classpath, and turns on secure processing (no extension functions, JDK processing limits). The expressions still run against the in-memory DOM, so results are unchanged.RegexURLNormalizerreads its rules file withSecureDocumentBuilderFactory.newDefaultInstance(), so external DTDs and entities are no longer fetched. Before, a rules file declaring an external DTD made the normalizer load no rules if the DTD could not be fetched.RegexURLNormalizerTestcovers this; it fails on main.Left out on purpose:
parse.filter.LDJsonParseFilterandRobotsTags, removed in #158 remove the DOM-based LDJsonParseFilter and LinkParseFilter #2253.SAXParserFactoryin the TikaParserBolt, which already rejects any DOCTYPE and so is stricter than the library default. That file is also changed by Tika ParserBolt: apply the JSoupFilters to the documents parsed by Tika #2256, #2211 Migrate core to HttpClient 5 and preserve parsing behavior #2236 and #315 Adaptative URL filter to normalize URLs based on canonical tag #2052.