Moderate severityNVD Advisory· Published Aug 20, 2013· Updated Apr 29, 2026
CVE-2013-2172
CVE-2013-2172
Description
jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java in Apache Santuario XML Security for Java 1.4.x before 1.4.8 and 1.5.x before 1.5.5 allows context-dependent attackers to spoof an XML Signature by using the CanonicalizationMethod parameter to specify an arbitrary weak "canonicalization algorithm to apply to the SignedInfo part of the Signature."
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.santuario:xmlsecMaven | >= 1.4.0, < 1.4.8 | 1.4.8 |
org.apache.santuario:xmlsecMaven | >= 1.5.0, < 1.5.5 | 1.5.5 |
Affected products
7cpe:2.3:a:apache:santuario_xml_security_for_java:1.4.7:*:*:*:*:*:*:*+ 5 more
- cpe:2.3:a:apache:santuario_xml_security_for_java:1.4.7:*:*:*:*:*:*:*
- cpe:2.3:a:apache:santuario_xml_security_for_java:1.5.0:*:*:*:*:*:*:*
- cpe:2.3:a:apache:santuario_xml_security_for_java:1.5.1:*:*:*:*:*:*:*
- cpe:2.3:a:apache:santuario_xml_security_for_java:1.5.2:*:*:*:*:*:*:*
- cpe:2.3:a:apache:santuario_xml_security_for_java:1.5.3:*:*:*:*:*:*:*
- cpe:2.3:a:apache:santuario_xml_security_for_java:1.5.4:*:*:*:*:*:*:*
Patches
225e0e11493b0Don't allow non-standard c14n method
1 file changed · +18 −2
src/org/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java+18 −2 modified@@ -45,8 +45,12 @@ public class DOMCanonicalizationMethod extends DOMTransform * @param spi TransformService */ public DOMCanonicalizationMethod(TransformService spi) - throws InvalidAlgorithmParameterException { - super(spi); + throws InvalidAlgorithmParameterException + { + super(spi); + if (!(spi instanceof ApacheCanonicalizer) && !isC14Nalg(spi.getAlgorithm())) { + throw new InvalidAlgorithmParameterException("Illegal CanonicalizationMethod"); + } } /** @@ -59,6 +63,9 @@ public DOMCanonicalizationMethod(TransformService spi) public DOMCanonicalizationMethod(Element cmElem, XMLCryptoContext context, Provider provider) throws MarshalException { super(cmElem, context, provider); + if (!(spi instanceof ApacheCanonicalizer) && !isC14Nalg(spi.getAlgorithm())) { + throw new MarshalException("Illegal CanonicalizationMethod"); + } } /** @@ -102,4 +109,13 @@ public int hashCode() { assert false : "hashCode not designed"; return 42; } + + private static boolean isC14Nalg(String alg) { + return alg.equals(CanonicalizationMethod.INCLUSIVE) + || alg.equals(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS) + || alg.equals(CanonicalizationMethod.EXCLUSIVE) + || alg.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) + || alg.equals(DOMCanonicalXMLC14N11Method.C14N_11) + || alg.equals(DOMCanonicalXMLC14N11Method.C14N_11_WITH_COMMENTS); + } }
8e8f8bf92a43Don't allow non-standard c14n method
1 file changed · +15 −0
src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.java+15 −0 modified@@ -50,6 +50,9 @@ public DOMCanonicalizationMethod(TransformService spi) throws InvalidAlgorithmParameterException { super(spi); + if (!(spi instanceof ApacheCanonicalizer) && !isC14Nalg(spi.getAlgorithm())) { + throw new InvalidAlgorithmParameterException("Illegal CanonicalizationMethod"); + } } /** @@ -64,6 +67,9 @@ public DOMCanonicalizationMethod(Element cmElem, XMLCryptoContext context, throws MarshalException { super(cmElem, context, provider); + if (!(spi instanceof ApacheCanonicalizer) && !isC14Nalg(spi.getAlgorithm())) { + throw new MarshalException("Illegal CanonicalizationMethod"); + } } /** @@ -111,4 +117,13 @@ public int hashCode() { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do } + + private static boolean isC14Nalg(String alg) { + return alg.equals(CanonicalizationMethod.INCLUSIVE) + || alg.equals(CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS) + || alg.equals(CanonicalizationMethod.EXCLUSIVE) + || alg.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) + || alg.equals(DOMCanonicalXMLC14N11Method.C14N_11) + || alg.equals(DOMCanonicalXMLC14N11Method.C14N_11_WITH_COMMENTS); + } }
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
32- svn.apache.org/viewvc/santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/jcp/xml/dsig/internal/dom/DOMCanonicalizationMethod.javanvdPatchWEB
- santuario.apache.org/secadv.data/CVE-2013-2172.txt.ascnvdVendor AdvisoryWEB
- secunia.com/advisories/54019nvdVendor Advisory
- github.com/advisories/GHSA-r237-w2w6-jq3pghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2013-2172ghsaADVISORY
- rhn.redhat.com/errata/RHSA-2013-1207.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1208.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1209.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1217.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1218.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1219.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1220.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1375.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1437.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-1853.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2014-0212.htmlnvdWEB
- seclists.org/fulldisclosure/2014/Dec/23nvdWEB
- www.debian.org/security/2014/dsa-3065nvdWEB
- www.oracle.com/technetwork/topics/security/cpujul2014-1972956.htmlnvdWEB
- www.ubuntu.com/usn/USN-2028-1nvdWEB
- www.vmware.com/security/advisories/VMSA-2014-0012.htmlnvdWEB
- github.com/apache/santuario-java/commit/25e0e11493b061749f778030036cb5c406b34590ghsaWEB
- github.com/apache/santuario-java/commit/8e8f8bf92a43608d7d5f9e357fae19244454a61fghsaWEB
- lists.apache.org/thread.html/680e6938b6412e26d5446054fd31de2011d33af11786b989127d1cc3%40%3Ccommits.santuario.apache.org%3EnvdWEB
- lists.apache.org/thread.html/680e6938b6412e26d5446054fd31de2011d33af11786b989127d1cc3@%3Ccommits.santuario.apache.org%3EghsaWEB
- lists.apache.org/thread.html/r1c07a561426ec5579073046ad7f4207cdcef452bb3100abaf908e0cd%40%3Ccommits.santuario.apache.org%3EnvdWEB
- lists.apache.org/thread.html/r1c07a561426ec5579073046ad7f4207cdcef452bb3100abaf908e0cd@%3Ccommits.santuario.apache.org%3EghsaWEB
- web.archive.org/web/20160317145515/http://www.securityfocus.com/archive/1/534161/100/0/threadedghsaWEB
- web.archive.org/web/20200228060314/http://www.securityfocus.com/bid/60846ghsaWEB
- www.osvdb.org/94651nvd
- www.securityfocus.com/archive/1/534161/100/0/threadednvd
- www.securityfocus.com/bid/60846nvd
News mentions
0No linked articles in our index yet.