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

Fix XXE Validation #3042

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.util.Collection;
import java.util.List;

import javax.xml.parsers.SAXParser;

import org.jbpm.compiler.xml.core.ExtensibleXmlParser;
import org.jbpm.compiler.xml.core.SemanticModules;
import org.jbpm.ruleflow.core.RuleFlowProcess;
Expand All @@ -46,10 +44,7 @@ public class XmlProcessReader {
private List<Process> processes;

public XmlProcessReader(final SemanticModules modules, ClassLoader classLoader) {
this(modules, classLoader, null);
}

public XmlProcessReader(final SemanticModules modules, ClassLoader classLoader, final SAXParser parser) {
this.parser = new ExtensibleXmlParser() {
@Override
protected String buildPrintMessage(final SAXParseException x) {
Expand All @@ -73,9 +68,6 @@ public void fatalError(final SAXParseException x) throws SAXParseException {
}
};

if (parser != null) {
this.parser.setParser(parser);
}
this.parser.setSemanticModules(modules);
this.parser.setData(new ProcessBuildData());
this.parser.setClassLoader(classLoader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import java.io.InputStream;
import java.io.Reader;

import javax.xml.parsers.SAXParser;

import org.drools.drl.ast.descr.PackageDescr;
import org.jbpm.compiler.xml.core.ExtensibleXmlParser;
import org.jbpm.compiler.xml.core.SemanticModules;
Expand All @@ -33,15 +31,7 @@ public class XmlPackageReader {
private PackageDescr packageDescr;

public XmlPackageReader(final SemanticModules modules) {
this(modules, null);
}

public XmlPackageReader(final SemanticModules modules, final SAXParser parser) {
if (parser == null) {
this.parser = new ExtensibleXmlParser();
} else {
this.parser = new ExtensibleXmlParser(parser);
}
this.parser = new ExtensibleXmlParser();
this.parser.setSemanticModules(modules);
}

Expand All @@ -57,8 +47,7 @@ public ExtensibleXmlParser getParser() {
*
* @return The rule-set.
*/
public PackageDescr read(final Reader reader) throws SAXException,
IOException {
public PackageDescr read(final Reader reader) throws SAXException, IOException {
this.packageDescr = (PackageDescr) this.parser.read(reader);
return this.packageDescr;
}
Expand Down
Loading