Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

mxGraphViewImageReader.java vulnerable to XXE attack #124

Closed
lehanhua opened this issue Nov 22, 2017 · 3 comments
Closed

mxGraphViewImageReader.java vulnerable to XXE attack #124

lehanhua opened this issue Nov 22, 2017 · 3 comments

Comments

@lehanhua
Copy link

SAXParserFactory instance in convert() is missing flags to prevent external entity and doctype declaration, making it vulnerable to XXE attacks. At minimum set the flags used in ExportServlet.java example. Setting "http://apache.org/xml/features/nonvalidating/load-external-dtd" to false would additionally prevent loading of external DTD.

Below are steps to reproduce. It'll need external DTD to actually extract anything but from the stack trace is sufficient to show the class is vulnerable to XXE

  1. Set up and run the Java example
  2. POST to ServerView with the following payload
    xml=]>%26xxe%3b%26xxe;
  3. Make a GET request to http://localhost:8080/ServerView
  4. Verify it's trying to read an non-existent "/blah" file
@alderg
Copy link
Contributor

alderg commented Nov 23, 2017

Thanks for the report. This will be fixed in the next release.

@alderg alderg closed this as completed Nov 23, 2017
@sylvestre
Copy link

Could you please tell us in which patch this issue has been fixed?
Thanks

@davidjgraph
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants