Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B8313200AC6 for ; Fri, 6 May 2016 13:03:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B5B391609F6; Fri, 6 May 2016 11:03:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0990C160A0C for ; Fri, 6 May 2016 13:03:13 +0200 (CEST) Received: (qmail 29517 invoked by uid 500); 6 May 2016 11:03:13 -0000 Mailing-List: contact dev-help@shiro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@shiro.apache.org Delivered-To: mailing list dev@shiro.apache.org Received: (qmail 29494 invoked by uid 99); 6 May 2016 11:03:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 May 2016 11:03:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CC1942C14F9 for ; Fri, 6 May 2016 11:03:12 +0000 (UTC) Date: Fri, 6 May 2016 11:03:12 +0000 (UTC) From: "Moritz Bechler (JIRA)" To: dev@shiro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SHIRO-550) Pre-authentication deserialization vulnerability MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 06 May 2016 11:03:14 -0000 [ https://issues.apache.org/jira/browse/SHIRO-550?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D15273= 916#comment-15273916 ]=20 Moritz Bechler commented on SHIRO-550: -------------------------------------- 5 months and no fix.... This is really really serious, should get a CVE and= a security fix released ASAP. Shiro even comes with a dependency on commons-beanutils (which transitively= depends on commons-collections), both of which contain exploitable gadgets= so one must assume that almost every user of shiro is exploitable. Side note: the deserialization classloading is buggy with regards to array = types - that breaks some of the public gadgets - but I can assure you that = this can be worked around. I think both needs to be done: - disable remember me by default. - randomize the key (so that enabling it would not mean direct RCE, also th= e current default behavior allows the client to send whatever principals he= likes) > Pre-authentication deserialization vulnerability > ------------------------------------------------ > > Key: SHIRO-550 > URL: https://issues.apache.org/jira/browse/SHIRO-550 > Project: Shiro > Issue Type: Bug > Components: RememberMe > Affects Versions: 1.2.4 > Reporter: Tim Stibbs > > The way shiro is set up by default exposes a web application to deseriali= zation attacks. This is dangerous anyway, but particularly in light of the = recent exploits using commons-collections (see http://foxglovesecurity.com/= 2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-applic= ation-have-in-common-this-vulnerability/ for more info). > By default, shiro uses the {{CookieRememberMeManager}}. This serializes, = encrypts and encodes the users identity for later retrieval. Therefore, whe= n it receives a request from an unauthenticated user, it looks for their re= membered identity by doing the following: > * Retrieve the value of the {{rememberMe}} cookie > * Base 64 decode > * Decrypt using AES > * Deserialize using java serialization ({{ObjectInputStream}}). > However, the default encryption key is hardcoded, meaning anyone with acc= ess to the source code knows what the default encryption key is. So, an att= acker can create a malicious object, serialize it, encode it, then send it = as a cookie. Shiro will then decode and deserialize, meaning that your mali= cious object is now live on the server. With careful construction of the ob= jects, they can be made to run some malicious code (see link above for more= detail). > Note this is not theoretical; I have a working exploit using the [ysoseri= al commons-collections4 exploit|https://github.com/frohoff/ysoserial/blob/m= aster/src/main/java/ysoserial/payloads/CommonsCollections2.java] and http c= lient. I can provide my test code if required. > I understand that this requires your shiro to be set up using the default= remember me settings, but in my case my application doesn't even make use = of the remember me functionality (there=E2=80=99s no way for the user to as= k to be remembered), so I didn't even consider that I needed to secure this= part. Yet, my application still has this vulnerability. -- This message was sent by Atlassian JIRA (v6.3.4#6332)