Skip to content
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

Disable access to external entities in XML parsing #200

Closed
flo-dup opened this issue Dec 2, 2020 · 1 comment · Fixed by #215
Closed

Disable access to external entities in XML parsing #200

flo-dup opened this issue Dec 2, 2020 · 1 comment · Fixed by #215
Assignees

Comments

@flo-dup
Copy link
Contributor

flo-dup commented Dec 2, 2020

  • Do you want to request a feature or report a bug?
    Security vulnerability correction

  • What is the current behavior?
    XML parsers factories can access external entities, see DomUtil.java file

  • What is the expected behavior?
    XML parsers factories should not be granted external access

  • What is the motivation / use case for changing the behavior?
    Quality gate passed / avoiding security vulnerability

@flo-dup
Copy link
Contributor Author

flo-dup commented Dec 2, 2020

XML parsers factories used should ensure setting attributes XMLConstants.ACCESS_EXTERNAL_SCHEMA, XMLConstants.ACCESS_EXTERNAL_DTD and XMLConstants.ACCESS_EXTERNAL_STYLESHEET to "".
Nonetheless, users having the latest version of Xalan (2.7.2, released in 2014), or users having other libraries not supporting thoses attributes, would encounter an exception when this attribute is set. We should

  • either ensure we are using a TransformerFactory and a DocumentBuilderFactory supporting those attributes by discarding those who don't in the ServiceLoader? by forcing to use the jdk internal xalan?
  • or set those attributes anyway, log an explicit error message, and document how to exclude Xalan or others in the migration guide

Note that a new release of Xalan was "looked forward" by the project management committee a year ago, but does not seem to be very likely anymore as the community is not very active (see the corresponding board minutes).

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 a pull request may close this issue.

2 participants