Moderate severityNVD Advisory· Published Mar 12, 2013· Updated Apr 29, 2026
CVE-2013-0239
CVE-2013-0239
Description
Apache CXF before 2.5.9, 2.6.x before 2.6.6, and 2.7.x before 2.7.3, when the plaintext UsernameToken WS-SecurityPolicy is enabled, allows remote attackers to bypass authentication via a security header of a SOAP request containing a UsernameToken element that lacks a password child element.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.cxf:cxf-rt-frontend-jaxrsMaven | < 2.5.9 | 2.5.9 |
org.apache.cxf:cxf-rt-frontend-jaxrsMaven | >= 2.6.0, < 2.6.6 | 2.6.6 |
org.apache.cxf:cxf-rt-frontend-jaxrsMaven | >= 2.7.0, < 2.7.3 | 2.7.3 |
Affected products
26cpe:2.3:a:apache:cxf:*:*:*:*:*:*:*:*+ 25 more
- cpe:2.3:a:apache:cxf:*:*:*:*:*:*:*:*range: <=2.5.8
- cpe:2.3:a:apache:cxf:2.4.0:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.1:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.2:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.3:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.4:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.5:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.6:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.4.7:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.0:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.1:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.2:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.3:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.4:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.5:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.6:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.5.7:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.6.0:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.6.1:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.6.2:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.6.3:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.6.4:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.6.5:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.7.0:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.7.1:*:*:*:*:*:*:*
- cpe:2.3:a:apache:cxf:2.7.2:*:*:*:*:*:*:*
Patches
1e4c6b3b0899e[CXF-4776] - Fix + re-enable tests
3 files changed · +53 −4
rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/UsernameTokenPolicyValidator.java+28 −1 modified@@ -29,6 +29,8 @@ import org.apache.cxf.ws.policy.AssertionInfo; import org.apache.cxf.ws.policy.AssertionInfoMap; import org.apache.cxf.ws.security.policy.SP12Constants; +import org.apache.cxf.ws.security.policy.SPConstants; +import org.apache.cxf.ws.security.policy.model.SupportingToken; import org.apache.ws.security.WSConstants; import org.apache.ws.security.WSSecurityEngineResult; import org.apache.ws.security.message.token.UsernameToken; @@ -94,10 +96,15 @@ public boolean checkTokens( ai.setNotAsserted("Password hashing policy not enforced"); return false; } - if (usernameTokenPolicy.isNoPassword() && usernameToken.getPassword() != null) { + if (usernameTokenPolicy.isNoPassword() && (usernameToken.getPassword() != null)) { ai.setNotAsserted("Username Token NoPassword policy not enforced"); return false; + } else if (!usernameTokenPolicy.isNoPassword() && (usernameToken.getPassword() == null) + && isNonEndorsingSupportingToken(usernameTokenPolicy)) { + ai.setNotAsserted("Username Token No Password supplied"); + return false; } + if (usernameTokenPolicy.isRequireCreated() && (usernameToken.getCreated() == null || usernameToken.isHashed())) { ai.setNotAsserted("Username Token Created policy not enforced"); @@ -112,4 +119,24 @@ public boolean checkTokens( return true; } + /** + * Return true if this UsernameToken policy is a (non-endorsing)SupportingToken. If this is + * true then the corresponding UsernameToken must have a password element. + */ + private boolean isNonEndorsingSupportingToken( + org.apache.cxf.ws.security.policy.model.UsernameToken usernameTokenPolicy + ) { + SupportingToken supportingToken = usernameTokenPolicy.getSupportingToken(); + if (supportingToken != null) { + SPConstants.SupportTokenType type = supportingToken.getTokenType(); + if (type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SUPPORTING + || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED + || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENCRYPTED + || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_ENCRYPTED) { + return true; + } + } + return false; + } + }
rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java+25 −1 modified@@ -55,6 +55,7 @@ import org.apache.cxf.ws.security.SecurityConstants; import org.apache.cxf.ws.security.policy.SP12Constants; import org.apache.cxf.ws.security.policy.SPConstants; +import org.apache.cxf.ws.security.policy.model.SupportingToken; import org.apache.cxf.ws.security.policy.model.UsernameToken; import org.apache.ws.security.WSConstants; import org.apache.ws.security.WSDocInfo; @@ -263,8 +264,11 @@ private UsernameToken assertUsernameTokens(SoapMessage message, WSUsernameTokenP tok = (UsernameToken)ai.getAssertion(); if (princ != null && tok.isHashPassword() != princ.isPasswordDigest()) { ai.setNotAsserted("Password hashing policy not enforced"); + } else if (princ != null && !tok.isNoPassword() && (princ.getPassword() == null) + && isNonEndorsingSupportingToken(tok)) { + ai.setNotAsserted("Username Token No Password supplied"); } else { - ai.setAsserted(true); + ai.setAsserted(true); } } ais = aim.getAssertionInfo(SP12Constants.SUPPORTING_TOKENS); @@ -277,6 +281,26 @@ private UsernameToken assertUsernameTokens(SoapMessage message, WSUsernameTokenP } return tok; } + + /** + * Return true if this UsernameToken policy is a (non-endorsing)SupportingToken. If this is + * true then the corresponding UsernameToken must have a password element. + */ + private boolean isNonEndorsingSupportingToken( + org.apache.cxf.ws.security.policy.model.UsernameToken usernameTokenPolicy + ) { + SupportingToken supportingToken = usernameTokenPolicy.getSupportingToken(); + if (supportingToken != null) { + SPConstants.SupportTokenType type = supportingToken.getTokenType(); + if (type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SUPPORTING + || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED + || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_SIGNED_ENCRYPTED + || type == SPConstants.SupportTokenType.SUPPORTING_TOKEN_ENCRYPTED) { + return true; + } + } + return false; + } private void addUsernameToken(SoapMessage message) { UsernameToken tok = assertUsernameTokens(message, null);
systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java+0 −2 modified@@ -71,7 +71,6 @@ public static void cleanup() throws Exception { } @org.junit.Test - @org.junit.Ignore public void testUsernameTokenInterceptorNoPasswordValidation() { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("org/apache/cxf/systest/ws/policy/client/javafirstclient.xml"); @@ -109,7 +108,6 @@ public void testUsernameTokenInterceptorNoPasswordValidation() { } @org.junit.Test - @org.junit.Ignore public void testUsernameTokenPolicyValidatorNoPasswordValidation() { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
25- svn.apache.org/viewvcnvdPatchWEB
- cxf.apache.org/cve-2013-0239.htmlnvdVendor AdvisoryWEB
- secunia.com/advisories/51988nvdVendor Advisory
- github.com/advisories/GHSA-p5c5-6564-vvr8ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2013-0239ghsaADVISORY
- packetstormsecurity.com/files/120214/Apache-CXF-WS-Security-UsernameToken-Bypass.htmlnvdWEB
- rhn.redhat.com/errata/RHSA-2013-0749.htmlnvdWEB
- seclists.org/fulldisclosure/2013/Feb/39nvdWEB
- exchange.xforce.ibmcloud.com/vulnerabilities/81981nvdWEB
- github.com/apache/cxf/commit/e4c6b3b0899ef2ba87c2610efc323b71c13dd421ghsaWEB
- lists.apache.org/thread.html/r36e44ffc1a9b365327df62cdfaabe85b9a5637de102cea07d79b2dbf%40%3Ccommits.cxf.apache.org%3EnvdWEB
- lists.apache.org/thread.html/r36e44ffc1a9b365327df62cdfaabe85b9a5637de102cea07d79b2dbf@%3Ccommits.cxf.apache.org%3EghsaWEB
- lists.apache.org/thread.html/rc774278135816e7afc943dc9fc78eb0764f2c84a2b96470a0187315c%40%3Ccommits.cxf.apache.org%3EnvdWEB
- lists.apache.org/thread.html/rc774278135816e7afc943dc9fc78eb0764f2c84a2b96470a0187315c@%3Ccommits.cxf.apache.org%3EghsaWEB
- lists.apache.org/thread.html/rd49aabd984ed540c8ff7916d4d79405f3fa311d2fdbcf9ed307839a6%40%3Ccommits.cxf.apache.org%3EnvdWEB
- lists.apache.org/thread.html/rd49aabd984ed540c8ff7916d4d79405f3fa311d2fdbcf9ed307839a6@%3Ccommits.cxf.apache.org%3EghsaWEB
- lists.apache.org/thread.html/rec7160382badd3ef4ad017a22f64a266c7188b9ba71394f0d321e2d4%40%3Ccommits.cxf.apache.org%3EnvdWEB
- lists.apache.org/thread.html/rec7160382badd3ef4ad017a22f64a266c7188b9ba71394f0d321e2d4@%3Ccommits.cxf.apache.org%3EghsaWEB
- lists.apache.org/thread.html/rfb87e0bf3995e7d560afeed750fac9329ff5f1ad49da365129b7f89e%40%3Ccommits.cxf.apache.org%3EnvdWEB
- lists.apache.org/thread.html/rfb87e0bf3995e7d560afeed750fac9329ff5f1ad49da365129b7f89e@%3Ccommits.cxf.apache.org%3EghsaWEB
- lists.apache.org/thread.html/rff42cfa5e7d75b7c1af0e37589140a8f1999e578a75738740b244bd4%40%3Ccommits.cxf.apache.org%3EnvdWEB
- lists.apache.org/thread.html/rff42cfa5e7d75b7c1af0e37589140a8f1999e578a75738740b244bd4@%3Ccommits.cxf.apache.org%3EghsaWEB
- web.archive.org/web/20200229102616/http://www.securityfocus.com/bid/57876ghsaWEB
- osvdb.org/90078nvd
- www.securityfocus.com/bid/57876nvd
News mentions
0No linked articles in our index yet.