CVE-2016-15011 (Java, published 2023-01-06T10:15Z)
Description: value: A vulnerability classified as problematic was found in e-Contract dssp up to 1.3.1. Affected by this vulnerability is the function checkSignResponse of the file dssp-client/src/main/java/be/e_contract/dssp/client/SignResponseVerifier.java. The manipulation leads to xml external entity reference. Upgrading to version 1.3.2 is able to address this issue. The identifier of the patch is ec4238349691ec66dd30b416ec6eaab02d722302. It is recommended to upgrade the affected component. The identifier VDB-217549 was assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-611 \u2014 Improper Restriction of XML External Entity Reference
The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
Repository: https://github.com/e-Contract/dssp
Files changed:
dssp-client/src/main/java/be/e_contract/dssp/client/SignResponseVerifier.java
dssp-client/src/main/java/be/e_contract/dssp/client/metadata/DigitalSignatureServiceMetadata.java
Commit message: 5342: fix XML external entity injection


Vulnerable code:
			signResponse = (SignResponse) unmarshaller.unmarshal(new ByteArrayInputStream(decodedSignResponseMessage));
		// DOM parsing
		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
		documentBuilderFactory.setNamespaceAware(true);
		DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
		InputStream signResponseInputStream = new ByteArrayInputStream(decodedSignResponseMessage);
		Document signResponseDocument = documentBuilder.parse(signResponseInputStream);

				.unmarshal(new URL(metadataLocation));

Fixed code:
import org.xml.sax.SAXParseException;

		// DOM parsing
		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
		documentBuilderFactory.setNamespaceAware(true);
		documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
		DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
		InputStream signResponseInputStream = new ByteArrayInputStream(decodedSignResponseMessage);
		Document signResponseDocument;
		try {
			signResponseDocument = documentBuilder.parse(signResponseInputStream);
		} catch (SAXParseException e) {
			throw new SecurityException("no valid SignResponse XML");
		}

			signResponse = (SignResponse) unmarshaller.unmarshal(signResponseDocument);
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
	private static final long serialVersionUID = 1L;

		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
		documentBuilderFactory.setNamespaceAware(true);
		documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
		DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
		Document document = documentBuilder.parse(new URL(metadataLocation).openStream());

				.unmarshal(document);