[docs] Treat caller-supplied parser instances as trusted configuration - #29
Open
ppkarwasz wants to merge 1 commit into
Open
[docs] Treat caller-supplied parser instances as trusted configuration#29ppkarwasz wants to merge 1 commit into
ppkarwasz wants to merge 1 commit into
Conversation
A recurring report shape builds its own permissively configured XMLReader, wraps it in a SAXSource, and reports the resulting entity resolution against the library. The code already takes a position on this (a SAXSource carrying its own XMLReader is trusted as-is), but the threat model never said it, so such a report could only land in MODEL-GAP. State it in the model: parser objects the caller constructs outside the library (XMLReader in a SAXSource, StAX readers in a StAXSource, a pre-parsed DOMSource) sit on the trusted side of the boundary, like the factory configuration. Add the matching out-of-scope bullet with the safe alternative (route your reader through XmlFactories.harden), a known non-finding describing the report shape, and widen the caller input disposition to cover it. Assisted-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
A recurring vulnerability-report shape builds its own permissively configured
XMLReader(external entities enabled), hands it to the library inside aSAXSource, and reports the resulting entity resolution as XXE. A recent report of this shape against Batik'sSAXDocumentFactory.createDocument(..., XMLReader)is typical.The code already takes a position on this channel:
HardeningTransformerFactorydocuments that aSAXSourcecarrying its ownXMLReaderis trusted as-is, with the caller expected to supply a hardened reader. The threat model, however, never said it: it covers loosened reserved settings, installed resolvers and caller-supplied top-level URIs, but not caller-constructed parser objects, so such a report could only land inMODEL-GAP.What
Docs-only change to
src/site/markdown/threat_model.md, four edits:XMLReaderin aSAXSource, StAX readers in aStAXSource, a pre-parsedDOMSource) sit on the trusted side of the boundary, like the factory configuration; the library hardens what it creates and does not re-harden what the caller built.XmlFactories.harden(XMLReader), or build it fromXmlFactories.newSAXParserFactory(), before wrapping it in aSAXSource).SAXSource, entity resolves), so triage can cite it directly.OUT-OF-SCOPE: caller inputrow now covers a parser instance the caller constructed outside the library.The added prose follows semantic line breaks, so the rendered page is unchanged in structure and future diffs stay per-sentence.
🤖 Generated with Claude Code