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.