VYPR
Moderate severityNVD Advisory· Published Jul 7, 2014· Updated May 6, 2026

CVE-2014-0034

CVE-2014-0034

Description

The SecurityTokenService (STS) in Apache CXF before 2.6.12 and 2.7.x before 2.7.9 does not properly validate SAML tokens when caching is enabled, which allows remote attackers to gain access via an invalid SAML token.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.apache.cxf:cxf-rt-ws-securityMaven
< 2.6.122.6.12
org.apache.cxf:cxf-rt-ws-securityMaven
>= 2.7.0, < 2.7.92.7.9

Affected products

23
  • Apache/Cxf21 versions
    cpe:2.3:a:apache:cxf:*:*:*:*:*:*:*:*+ 20 more
    • cpe:2.3:a:apache:cxf:*:*:*:*:*:*:*:*range: <=2.6.11
    • 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.10:*:*:*:*:*:*:*
    • 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.6.6:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.6.7:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.6.8:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.6.9:*:*:*:*:*:*:*
    • 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:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.7.3:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.7.4:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.7.5:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.7.6:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.7.7:*:*:*:*:*:*:*
    • cpe:2.3:a:apache:cxf:2.7.8:*:*:*:*:*:*:*
  • cpe:2.3:a:redhat:jboss_enterprise_application_platform:6.0.0:*:*:*:*:*:*:*+ 1 more
    • cpe:2.3:a:redhat:jboss_enterprise_application_platform:6.0.0:*:*:*:*:*:*:*
    • cpe:2.3:a:redhat:jboss_enterprise_application_platform:6.2.0:*:*:*:*:*:*:*

Patches

1
b4b9a010bb23

Validation fix in the STS

https://github.com/apache/cxfColm O HeigeartaighDec 16, 2013via ghsa
2 files changed · +72 25
  • services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java+23 24 modified
    @@ -153,6 +153,29 @@ public TokenValidatorResponse validateToken(TokenValidatorParameters tokenParame
                 SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipalImpl(assertion);
                 response.setPrincipal(samlPrincipal);
                 
    +            if (!assertion.isSigned()) {
    +                LOG.log(Level.WARNING, "The received assertion is not signed, and therefore not trusted");
    +                return response;
    +            }
    +
    +            RequestData requestData = new RequestData();
    +            requestData.setSigVerCrypto(sigCrypto);
    +            WSSConfig wssConfig = WSSConfig.getNewInstance();
    +            requestData.setWssConfig(wssConfig);
    +            requestData.setCallbackHandler(callbackHandler);
    +            requestData.setMsgContext(tokenParameters.getWebServiceContext().getMessageContext());
    +
    +            WSDocInfo docInfo = new WSDocInfo(validateTargetElement.getOwnerDocument());
    +
    +            // Verify the signature
    +            Signature sig = assertion.getSignature();
    +            KeyInfo keyInfo = sig.getKeyInfo();
    +            SAMLKeyInfo samlKeyInfo = 
    +                SAMLUtil.getCredentialFromKeyInfo(
    +                    keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(requestData, docInfo), sigCrypto
    +                );
    +            assertion.verifySignature(samlKeyInfo);
    +                
                 SecurityToken secToken = null;
                 byte[] signatureValue = assertion.getSignatureValue();
                 if (tokenParameters.getTokenStore() != null && signatureValue != null
    @@ -169,29 +192,6 @@ public TokenValidatorResponse validateToken(TokenValidatorParameters tokenParame
                 }
                 
                 if (secToken == null) {
    -                if (!assertion.isSigned()) {
    -                    LOG.log(Level.WARNING, "The received assertion is not signed, and therefore not trusted");
    -                    return response;
    -                }
    -                
    -                RequestData requestData = new RequestData();
    -                requestData.setSigVerCrypto(sigCrypto);
    -                WSSConfig wssConfig = WSSConfig.getNewInstance();
    -                requestData.setWssConfig(wssConfig);
    -                requestData.setCallbackHandler(callbackHandler);
    -                requestData.setMsgContext(tokenParameters.getWebServiceContext().getMessageContext());
    -
    -                WSDocInfo docInfo = new WSDocInfo(validateTargetElement.getOwnerDocument());
    -                
    -                // Verify the signature
    -                Signature sig = assertion.getSignature();
    -                KeyInfo keyInfo = sig.getKeyInfo();
    -                SAMLKeyInfo samlKeyInfo = 
    -                    SAMLUtil.getCredentialFromKeyInfo(
    -                        keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(requestData, docInfo), sigCrypto
    -                    );
    -                assertion.verifySignature(samlKeyInfo);
    -                
                     // Validate the assertion against schemas/profiles
                     validateAssertion(assertion);
     
    @@ -211,7 +211,6 @@ public TokenValidatorResponse validateToken(TokenValidatorParameters tokenParame
                     if (!certConstraints.matches(cert)) {
                         return response;
                     }
    -                
                 }
                 
                 // Parse roles from the validated token
    
  • services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java+49 1 modified
    @@ -34,6 +34,7 @@
     
     import org.w3c.dom.Document;
     import org.w3c.dom.Element;
    +
     import org.apache.cxf.jaxws.context.WebServiceContextImpl;
     import org.apache.cxf.jaxws.context.WrappedMessageContext;
     import org.apache.cxf.message.MessageImpl;
    @@ -425,6 +426,53 @@ public void testSAML2AssertionWithRolesCaching() throws Exception {
             assertTrue(roles.iterator().next().getName().equals("employee"));
         }
         
    +    /**
    +     * Test an invalid SAML 2 Assertion
    +     */
    +    @org.junit.Test
    +    public void testInvalidSAML2Assertion() throws Exception {
    +        TokenValidator samlTokenValidator = new SAMLTokenValidator();
    +        TokenValidatorParameters validatorParameters = createValidatorParameters();
    +        TokenRequirements tokenRequirements = validatorParameters.getTokenRequirements();
    +        
    +        // Create a ValidateTarget consisting of a SAML Assertion
    +        Crypto crypto = CryptoFactory.getInstance(getEncryptionProperties());
    +        CallbackHandler callbackHandler = new PasswordCallbackHandler();
    +        Element samlToken = 
    +            createSAMLAssertion(WSConstants.WSS_SAML2_TOKEN_TYPE, crypto, "mystskey", callbackHandler);
    +        Document doc = samlToken.getOwnerDocument();
    +        samlToken = (Element)doc.appendChild(samlToken);
    +        
    +        ReceivedToken validateTarget = new ReceivedToken(samlToken);
    +        tokenRequirements.setValidateTarget(validateTarget);
    +        validatorParameters.setToken(validateTarget);
    +        
    +        assertTrue(samlTokenValidator.canHandleToken(validateTarget));
    +        
    +        TokenValidatorResponse validatorResponse = 
    +            samlTokenValidator.validateToken(validatorParameters);
    +        assertTrue(validatorResponse != null);
    +        assertTrue(validatorResponse.getToken() != null);
    +        assertTrue(validatorResponse.getToken().getState() == STATE.VALID);
    +        
    +        // Replace "alice" with "bob".
    +        Element nameID = 
    +            (Element)samlToken.getElementsByTagNameNS(WSConstants.SAML2_NS, "NameID").item(0);
    +        nameID.setTextContent("bob");
    +        
    +        // Now validate again
    +        validateTarget = new ReceivedToken(samlToken);
    +        tokenRequirements.setValidateTarget(validateTarget);
    +        validatorParameters.setToken(validateTarget);
    +        
    +        assertTrue(samlTokenValidator.canHandleToken(validateTarget));
    +        
    +        validatorResponse = samlTokenValidator.validateToken(validatorParameters);
    +        assertTrue(validatorResponse != null);
    +        assertTrue(validatorResponse.getToken() != null);
    +        assertTrue(validatorResponse.getToken().getState() != STATE.VALID);
    +    }
    +    
         private TokenValidatorParameters createValidatorParameters() throws WSSecurityException {
             TokenValidatorParameters parameters = new TokenValidatorParameters();
             
    @@ -627,5 +675,5 @@ public void handle(Callback[] callbacks) throws IOException,
             }
         }
         
    -    
    +
     }
    

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

24

News mentions

0

No linked articles in our index yet.