Re: [OAUTH-WG] open redirect in rfc6749

Hans Zandbelt <hzandbelt@pingidentity.com> Wed, 03 September 2014 16:51 UTC

Return-Path: <hzandbelt@pingidentity.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AB1661A00AB for <oauth@ietfa.amsl.com>; Wed, 3 Sep 2014 09:51:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.201
X-Spam-Level:
X-Spam-Status: No, score=-4.201 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bu9rFHNrJ-Ys for <oauth@ietfa.amsl.com>; Wed, 3 Sep 2014 09:51:38 -0700 (PDT)
Received: from na3sys009aog137.obsmtp.com (na3sys009aog137.obsmtp.com [74.125.149.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C84CD1A02E1 for <oauth@ietf.org>; Wed, 3 Sep 2014 09:51:30 -0700 (PDT)
Received: from mail-wi0-f170.google.com ([209.85.212.170]) (using TLSv1) by na3sys009aob137.postini.com ([74.125.148.12]) with SMTP ID DSNKVAdHEgGk6UG9HDSCWkqOaKHOaulm97Fd@postini.com; Wed, 03 Sep 2014 09:51:30 PDT
Received: by mail-wi0-f170.google.com with SMTP id cc10so6195139wib.1 for <oauth@ietf.org>; Wed, 03 Sep 2014 09:51:29 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Eqv4exsBtRPOgDwNmKhmujegPERKVYJGMqzwsHb2nXo=; b=ktfKixEHtr4A1qpq/0Xc0imjhvj3oWvDpuW3bbjs9LCWcUrhknExbd+QvwBXUt6mZk +ny9yfyLEWzncGRowi6p9cVe0TcAL5QzVtFOaYr5u7vnnQK9GRY0DxpAwtQSbmsPtY7f hDnsvoYczkSUrf97iyhUDT11C1GSXgT8k+mujgWvPeR4G/DKGZMmVTWZ/tdaz3zOIWe+ z1elLdcFZdQPQggGEmW9ORd0ahtsAqQ9vnHh243X5MnR+wumkms0AQWz5ZGE6ZRVO7Yo FM7/1jjNju/nwRzfx0xCmCv8uJTkmGW46+0SsmEXxeMQyibzzQeJY6X6l9yvwQjc1jTt xTMA==
X-Gm-Message-State: ALoCoQma5j+yobJBYdTBJR9CiC4vnklu9DcIosELRkiuzF+tdg1QDsaHCD7mr+F+h2RVu+NXTDpfH7F3nolljvOWR+WgSpkjd4wl/Qpt/7ZAKSDQnfNEr8aytIo3k5aR1Nzq4b+CEzYp
X-Received: by 10.194.184.101 with SMTP id et5mr49398119wjc.14.1409763089257; Wed, 03 Sep 2014 09:51:29 -0700 (PDT)
X-Received: by 10.194.184.101 with SMTP id et5mr49397963wjc.14.1409763088169; Wed, 03 Sep 2014 09:51:28 -0700 (PDT)
Received: from [192.168.10.222] (5ED52E8A.cm-7-6a.dynamic.ziggo.nl. [94.213.46.138]) by mx.google.com with ESMTPSA id ju1sm16654052wjc.1.2014.09.03.09.51.26 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 09:51:27 -0700 (PDT)
Message-ID: <5407470B.2010904@pingidentity.com>
Date: Wed, 03 Sep 2014 18:51:23 +0200
From: Hans Zandbelt <hzandbelt@pingidentity.com>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Antonio Sanso <asanso@adobe.com>, John Bradley <ve7jtb@ve7jtb.com>
References: <756EEB25-89E8-4445-9DA0-5522787D51AB@adobe.com> <54073D6F.6070203@redhat.com> <7A3A12C9-2A3B-48B1-BD5D-FD467EA03EE8@ve7jtb.com> <58148F80-C2DD-45C5-8D6F-CED74A90AA75@adobe.com>
In-Reply-To: <58148F80-C2DD-45C5-8D6F-CED74A90AA75@adobe.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: http://mailarchive.ietf.org/arch/msg/oauth/kUVL5XKqbK2m-CHDq-MicOUlqv0
Cc: "oauth@ietf.org" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] open redirect in rfc6749
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Sep 2014 16:51:41 -0000

Let me try and approach this from a different angle: why would you call 
it an open redirect when an invalid scope is provided and call it 
correct protocol behavior (hopefully) when a valid scope is provided?

Hans.

On 9/3/14, 6:46 PM, Antonio Sanso wrote:
> hi John,
> On Sep 3, 2014, at 6:14 PM, John Bradley <ve7jtb@ve7jtb.com
> <mailto:ve7jtb@ve7jtb.com>> wrote:
>
>> In the example the redirect_uri is vlid for the attacker.
>>
>> The issue is that the AS may be allowing client registrations with
>> arbitrary redirect_uri.
>>
>> In the spec it is unspecified how a AS validates that a client
>> controls the redirect_uri it is registering.
>>
>> I think that if anything it may be the registration step that needs
>> the security consideration.
>
> (this is the first time :p) but I do disagree with you. It would be
> pretty unpractical to block this at registration time….
> IMHO the best approach is the one taken from Google, namely returning
> 400 with the cause of the error..
>
> *400.* That’s an error.
>
> *Error: invalid_scope*
>
> Some requested scopes were invalid. {invalid=[l]}
>
> said that I hope you all agree this is an issue in the spec so far….
>
> regards
>
> antonio
>
>>
>> John B.
>>
>> On Sep 3, 2014, at 12:10 PM, Bill Burke <bburke@redhat.com
>> <mailto:bburke@redhat.com>> wrote:
>>
>>> I don't understand.  The redirect uri has to be valid in order for a
>>> redirect to happen.  The spec explicitly states this.
>>>
>>> On 9/3/2014 11:43 AM, Antonio Sanso wrote:
>>>> hi *,
>>>>
>>>> IMHO providers that strictly follow rfc6749 are vulnerable to open
>>>> redirect.
>>>> Let me explain, reading [0]
>>>>
>>>> If the request fails due to a missing, invalid, or mismatching
>>>>   redirection URI, or if the client identifier is missing or invalid,
>>>>   the authorization server SHOULD inform the resource owner of the
>>>>   error and MUST NOT automatically redirect the user-agent to the
>>>>   invalid redirection URI.
>>>>
>>>>   If the resource owner denies the access request or if the request
>>>>   fails for reasons other than a missing or invalid redirection URI,
>>>>   the authorization server informs the client by adding the following
>>>>   parameters to the query component of the redirection URI using the
>>>>   "application/x-www-form-urlencoded" format, perAppendix B
>>>>  <https://tools.ietf.org/html/rfc6749#appendix-B>:
>>>>
>>>> Now let’s assume this.
>>>> I am registering a new client to the victim.com <http://victim.com>
>>>> <http://victim.com>
>>>> provider.
>>>> I register redirect uri attacker.com <http://attacker.com>
>>>> <http://attacker.com>.
>>>>
>>>> According to [0] if I pass e.g. the wrong scope I am redirected back to
>>>> attacker.com <http://attacker.com> <http://attacker.com>.
>>>> Namely I prepare a url that is in this form:
>>>>
>>>> http://victim.com/authorize?response_type=code&client_id=bc88FitX1298KPj2WS259BBMa9_KCfL3&scope=WRONG_SCOPE&redirect_uri=http://attacker.com
>>>>
>>>> and this is works as an open redirector.
>>>> Of course in the positive case if all the parameters are fine this
>>>> doesn’t apply since the resource owner MUST approve the app via the
>>>> consent screen (at least once).
>>>>
>>>> A solution would be to return error 400 rather than redirect to the
>>>> redirect URI (as some provider e.g. Google do)
>>>>
>>>> WDYT?
>>>>
>>>> regards
>>>>
>>>> antonio
>>>>
>>>> [0] https://tools.ietf.org/html/rfc6749#section-4.1.2.1
>>>>
>>>>
>>>> _______________________________________________
>>>> OAuth mailing list
>>>> OAuth@ietf.org
>>>> https://www.ietf.org/mailman/listinfo/oauth
>>>>
>>>
>>> --
>>> Bill Burke
>>> JBoss, a division of Red Hat
>>> http://bill.burkecentral.com
>>>
>>> _______________________________________________
>>> OAuth mailing list
>>> OAuth@ietf.org
>>> https://www.ietf.org/mailman/listinfo/oauth
>>
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org <mailto:OAuth@ietf.org>
>> https://www.ietf.org/mailman/listinfo/oauth
>
>
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>

-- 
Hans Zandbelt              | Sr. Technical Architect
hzandbelt@pingidentity.com | Ping Identity