The secure validation of XML signatures is switched off
What it finds
The XML digital signature API of the JDK checks signatures in a secure mode that refuses weak algorithms and limits transforms and references. Setting the property org.jcp.xml.dsig.secureValidation to false turns that off, which lets crafted signatures pass or exhaust the validator (CWE-347), as the javax.xml.crypto documentation says.
Reported is setProperty with that property and false.
From the rule's source, insecure_xml_signature.rs.
import javax.xml.crypto.dsig.dom.DOMValidateContext; class Signatures { void check(DOMValidateContext context) { context.setProperty("org.jcp.xml.dsig.secureValidation", Boolean.FALSE);tx0 reports: without the secure mode context.setProperty("org.jcp.xml.dsig.secureValidation", Boolean.TRUE); }} Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/java:insecure-xml-signature" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/java:insecure-xml-signature] reason="..."tx0 explain tx0/java:insecure-xml-signature shows the same in the terminal. Found a false positive? Report it.