Skip to content

enable secure processing in XsltTransformer to block XXE#1499

Open
Usamak06 wants to merge 1 commit into
apache:masterfrom
Usamak06:xslt-secure-processing
Open

enable secure processing in XsltTransformer to block XXE#1499
Usamak06 wants to merge 1 commit into
apache:masterfrom
Usamak06:xslt-secure-processing

Conversation

@Usamak06

Copy link
Copy Markdown

XsltTransformer.transform creates its TransformerFactory with external entity resolution still enabled, so a DOCTYPE in the markup being transformed can declare a SYSTEM entity and read local files off the server. The sibling XSLTResourceStream already guards against this, so I set the same FEATURE_SECURE_PROCESSING flag here. Added a regression test that feeds an external-entity payload through the transformer and checks the file contents are not returned.

XsltTransformer builds a TransformerFactory with external entity
resolution still enabled, so a DOCTYPE in the markup it transforms can
declare a SYSTEM entity and read local files. Turn on
FEATURE_SECURE_PROCESSING, matching what XSLTResourceStream already does.
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