JDK-8149029 : Secure validation of XML based digital signature always enabled when checking wrapping attacks
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.xml.crypto
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-02-04
  • Updated: 2017-02-22
  • Resolved: 2016-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8u102 b01Fixed openjdk7uFixed
Related Reports
Relates :  
Relates :  
Description
One should be able to enable or disable the XML secure validation of digital signature using the DOMValidateContext property "org.jcp.xml.dsig.secureValidation" . In 8u, even when property value is Boolean.FALSE or unset the validation is triggered.

Below code sets the org.jcp.xml.dsig.secureValidation to false 

	DOMValidateContext vc = new DOMValidateContext(keyValueKS, element);
	vc.setBaseURI(base.toURI().toString());
	vc.setProperty("org.jcp.xml.dsig.secureValidation", Boolean.FALSE);

Immediate call to vc.getProperty() gives correct value but the value is not being considered while XML processing.


Comments
Only the patch to DOMURIDereferencer from JDK-8046949 should be backported: http://hg.openjdk.java.net/jdk9/jdk9/jdk/diff/7d6154df328c/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java
04-02-2016

The changes you refer to were fixed in JDK 9 in JDK-8046044. But in JDK 9 Generification of the javax.xml.crypto API took place: JDK-8046949. We need to check if mentioned changes are applicable for JDK 8.
04-02-2016