Skip to content

stop resolving external entities in JAX-WS payload blocks - #1336

Open
kali834x wants to merge 1 commit into
apache:masterfrom
kali834x:jaxws-payload-standalone-stax
Open

kali834x wants to merge 1 commit into
apache:masterfrom
kali834x:jaxws-payload-standalone-stax

Conversation

@kali834x

Copy link
Copy Markdown
Contributor

SourceBlockImpl, XMLStringBlockImpl and DataSourceBlockImpl now read their payload in _getReaderFromBO with StAXParserConfiguration.STANDALONE instead of the default StAXUtils configuration. the default leaves Woodstox resolving external entities and loading external DTDs, so when a Dispatch or Provider payload given as a StreamSource, String or DataSource carries ]>&e;, serializing the message inlines the file into the SOAP body that goes on the wire, and a DOCTYPE naming a SYSTEM DTD URL makes the reader open a connection to it (CWE-611). 3436bef hardened the identity transform for the same caller-supplied Source, but a StreamSource takes the direct StAX path in SourceBlockImpl and never reaches it, and the String and DataSource blocks do not transform at all. inbound messages are not affected, since those blocks are built from Axiom's SOAP parser, which already refuses a DOCTYPE; the exposure is an application that passes on XML it got from somewhere else, for example a gateway forwarding a client document through Dispatch or Dispatch. STANDALONE refuses the external entity and skips the external DTD while a DOCTYPE with only internal entities still parses, so the one behaviour change is that a payload which relied on an external entity or external DTD now fails to read. PayloadBlockExternalEntityTest points an entity at a temp file and fails for all three block types before the change, with an internal-entity control that passes both ways; jaxws (480 tests) and jaxws-integration (387, including the StreamSource, String and XML/HTTP DataSource dispatch and provider suites) pass.

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