Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E387D9A99 for ; Thu, 16 Feb 2012 18:55:26 +0000 (UTC) Received: (qmail 394 invoked by uid 500); 16 Feb 2012 18:55:26 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 362 invoked by uid 500); 16 Feb 2012 18:55:26 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 331 invoked by uid 99); 16 Feb 2012 18:55:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2012 18:55:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2012 18:55:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 975FE1BBB2E for ; Thu, 16 Feb 2012 18:54:59 +0000 (UTC) Date: Thu, 16 Feb 2012 18:54:59 +0000 (UTC) From: "Colm O hEigeartaigh (Resolved) (JIRA)" To: issues@cxf.apache.org Message-ID: <694417032.47229.1329418499621.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <795341083.24381.1328886064592.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (CXF-4099) SignedParts, EncryptedParts policy assertions are silently ignored on the client side if specified alone MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-4099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colm O hEigeartaigh resolved CXF-4099. -------------------------------------- Resolution: Fixed > SignedParts, EncryptedParts policy assertions are silently ignored on the client side if specified alone > -------------------------------------------------------------------------------------------------------- > > Key: CXF-4099 > URL: https://issues.apache.org/jira/browse/CXF-4099 > Project: CXF > Issue Type: Bug > Components: WS-* Components > Reporter: Andrei Shakirin > Assignee: Colm O hEigeartaigh > Fix For: 2.4.7, 2.5.3, 2.6 > > Attachments: cxf-rt-ws-security.patch > > > Hi, > Actually if client defines policy containing only SignedParts, EncryptedParts assertions without binding (Assymetric, Symmetric or Transport) CXF does nothing and send unsigned/unencrypted message. Exception is thrown only on service side (Assertion is not satisfied). I find it a little bit dangerous, because client can assume that message is encrypted. IMHO exception should be thrown already on client side. > Fix proposals: > A) PolicyVerificationOutInterceptor > As I can see PolicyVerificationOutInterceptor doesn't throw exception in case if policy assertions are not satisfied. > That means for outgoing messages (client request and server response) policy assertions can be not fulfilled and message will be sent anyway. > Code is below: > {code:java} > // CXF-1849 Log a message at FINE level if policy verification fails > // on the outbound-server side of a response > try { > aim.checkEffectivePolicy(policy.getPolicy()); > } catch (PolicyException e) { > LOG.fine("An exception was thrown when verifying that the effective policy for " > + "this request was satisfied. However, this exception will not result in " > + "a fault. The exception raised is: " > + e.toString()); > return; > } > LOG.fine("Verified policies for outbound message."); > {code} > For incoming messages unsatisfied assertion is interpreted as real problem and causes fault. > I am not sure about the reason of such different verification. > There are some cases where it can be critical even for outgoing message: encryption, compression. > B) If alternative A is not possible for some reasons, I would propose to implement additional interceptor, register it in WSSecurityPolicyInterceptorProvider and check specially for critcal security assertion satisfaction there. Interceptor should be called after PolicyBasedWSS4J* interceptors. > I am going to provide a patch either for A or B. > Regards, > Andrei. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira