Skip to content

Commit

Permalink
BZ1158017: fix potential XXE vulnerability in jBPM simulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Lindop committed Jan 5, 2015
1 parent 5af592f commit 2d2074a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
package org.jbpm.simulation.util;

import java.util.HashMap;
import java.util.Map;

import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.util.Bpmn2ResourceImpl;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.XMLSave;

public class JBPMBpmn2ResourceImpl extends Bpmn2ResourceImpl {

public JBPMBpmn2ResourceImpl(URI uri) {
super(uri);
}

// Switch off DTD external entity processing
Map parserFeatures = new HashMap();
parserFeatures.put("http://xml.org/sax/features/external-general-entities", false);
this.getDefaultLoadOptions().put(XMLResource.OPTION_PARSER_FEATURES, parserFeatures);

}

@Override
protected XMLSave createXMLSave() {
Expand Down

0 comments on commit 2d2074a

Please sign in to comment.