You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bval.apache.org by "Jörg Waßmer (JIRA)" <ji...@apache.org> on 2011/03/08 01:25:00 UTC

[jira] Created: (BVAL-92) Security wholes in org.apache.bval.util.PrivilegedActions

Security wholes in org.apache.bval.util.PrivilegedActions
---------------------------------------------------------

                 Key: BVAL-92
                 URL: https://issues.apache.org/jira/browse/BVAL-92
             Project: BeanValidation
          Issue Type: Bug
    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
            Reporter: Jörg Waßmer
            Priority: Critical


PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.

PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Roman Stumm (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Stumm reassigned BVAL-92:
-------------------------------

    Assignee: Roman Stumm

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Assignee: Roman Stumm
>            Priority: Critical
>             Fix For: 0.4-incubating
>
>         Attachments: apache-bval-20110327092101-jw.diff, apache-bval-20110327231539-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Jörg Waßmer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Waßmer updated BVAL-92:
----------------------------

    Attachment: apache-bval-20110327231539-jw.diff

Here the diff against the trunk tree, without the patches for BVAL-91.

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>         Attachments: apache-bval-20110327092101-jw.diff, apache-bval-20110327231539-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Jörg Waßmer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Waßmer updated BVAL-92:
----------------------------

    Attachment: apache-bval-20110327090410-jw.diff

Attached SVN diff for https://svn.apache.org/repos/asf/incubator/bval/trunk.

I was not able to fix some methods without risking to break things. Marked them with FIXME.

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>         Attachments: apache-bval-20110327090410-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Jörg Waßmer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Waßmer updated BVAL-92:
----------------------------

    Summary: Security holes in org.apache.bval.util.PrivilegedActions  (was: Security wholes in org.apache.bval.util.PrivilegedActions)

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008810#comment-13008810 ] 

Simone Tripodi commented on BVAL-92:
------------------------------------

Hi Jorg,
if you could provide a patch I would be pleased to apply.
Many thanks in advance!

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Jörg Waßmer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011999#comment-13011999 ] 

Jörg Waßmer commented on BVAL-92:
---------------------------------

doPrivileged() will be called only if there is a SecurityManager.

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>         Attachments: apache-bval-20110327092101-jw.diff, apache-bval-20110327231539-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Jörg Waßmer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Waßmer updated BVAL-92:
----------------------------

    Attachment:     (was: apache-bval-20110327090410-jw.diff)

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011932#comment-13011932 ] 

Mark Struberg commented on BVAL-92:
-----------------------------------

In OpenWebBeans we have implemented such areas as a SPI with 2 implementations: ManagedSecurityService (which does doPrivileged) and SimpleSecurityService (actually without security).
The reason is that 2 out of 1000 projects do really use the SecurityManager, all others don't ;) The performance difference is unbelievable! Under load doPrivileged calls will easily create a few million temporary instances per second and consuming up to 200MB temp object space which needs to be garbage collected.

About the security: Our ManagedSecurityService is only accessible via an internal singleton accessor and the constructor asserts (via Thread.currentThread().getStackTrace() ) that we really only got created via this singleton accessor.

Btw: we should simply not export those classes in our OSGi bundle descriptor.

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>         Attachments: apache-bval-20110327092101-jw.diff, apache-bval-20110327231539-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Jörg Waßmer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Waßmer updated BVAL-92:
----------------------------

    Attachment: apache-bval-20110327092101-jw.diff

Replaced the previous patch to also include fix for BVAL-91.

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>         Attachments: apache-bval-20110327092101-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011759#comment-13011759 ] 

Simone Tripodi commented on BVAL-92:
------------------------------------

thanks for your help! I'd like to ask you attaching two different patches for each Issue, since they have been reported as two different critical errors (even if they are about the same problem).
Many thanks in advance, and thanks once again

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Priority: Critical
>         Attachments: apache-bval-20110327092101-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (BVAL-92) Security holes in org.apache.bval.util.PrivilegedActions

Posted by "Roman Stumm (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BVAL-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Stumm resolved BVAL-92.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 0.4-incubating

Revision #1161648 
Committed by romanstumm at 25.08.11 19:14:15

applied patch "apache-bval-20110327231539-jw.diff" from Jörg Waßmer to fix Security holes in org.apache.bval.util.PrivilegedActions. Removed all deprecated and unused methods by changing the source code that still used deprecated methods.  


Also upgraded the apache-rat-plugin. 
Needed to enter a version for findbugs-maven-plugin, because I couldn't build with maven without it.

> Security holes in org.apache.bval.util.PrivilegedActions
> --------------------------------------------------------
>
>                 Key: BVAL-92
>                 URL: https://issues.apache.org/jira/browse/BVAL-92
>             Project: BeanValidation
>          Issue Type: Bug
>    Affects Versions: 0.2-incubating, 0.3-incubating, 0.4-incubating
>            Reporter: Jörg Waßmer
>            Assignee: Roman Stumm
>            Priority: Critical
>             Fix For: 0.4-incubating
>
>         Attachments: apache-bval-20110327092101-jw.diff, apache-bval-20110327231539-jw.diff
>
>
> PrivilegedActions is public. It offers several method, e.g. getClassLoader() which are executed surrounded by privileged actions. Thus any caller can get e.g. a classloader, even if the caller has not the required permissions.
> PrivilegedActions should offer only factory methods creating the privileged actions. Then the callers should call AccessController.doPrivileged() for themselves, such that the actions will be executed in the caller's security domain, instead of the domain of the BeanValidation API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira