-
-
Notifications
You must be signed in to change notification settings - Fork 79
Fix SchemaFactory configuration of XML validator #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -271,6 +271,9 @@ private Schema getXmlSchema16() throws SAXException { | |
|
|
||
| public Schema getXmlSchema(InputStream... inputStreams) throws SAXException { | ||
| final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); | ||
| schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, ""); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this actually prevent XEE? or does it only prevent unintended network access? what about
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The
I verified that this also prevents I will add |
||
| schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); | ||
| schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); | ||
| final Source[] schemaFiles = new Source[inputStreams.length]; | ||
| for (int i = 0; i < inputStreams.length; i++) { | ||
| schemaFiles[i] = new StreamSource(inputStreams[i]); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.