Re: [OAUTH-WG] OAuth v2-18 comment on "state" parameter

Eran Hammer-Lahav <eran@hueniverse.com> Fri, 15 July 2011 15:41 UTC

Return-Path: <eran@hueniverse.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6FB8721F88B2 for <oauth@ietfa.amsl.com>; Fri, 15 Jul 2011 08:41:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[AWL=-0.002, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J2SuC+t5Rna1 for <oauth@ietfa.amsl.com>; Fri, 15 Jul 2011 08:41:35 -0700 (PDT)
Received: from p3plex1out01.prod.phx3.secureserver.net (p3plex1out01.prod.phx3.secureserver.net [72.167.180.17]) by ietfa.amsl.com (Postfix) with SMTP id B560221F8868 for <oauth@ietf.org>; Fri, 15 Jul 2011 08:41:25 -0700 (PDT)
Received: (qmail 31187 invoked from network); 15 Jul 2011 15:41:25 -0000
Received: from unknown (HELO smtp.ex1.secureserver.net) (72.167.180.20) by p3plex1out01.prod.phx3.secureserver.net with SMTP; 15 Jul 2011 15:41:25 -0000
Received: from P3PW5EX1MB01.EX1.SECURESERVER.NET ([10.6.135.19]) by P3PW5EX1HT002.EX1.SECURESERVER.NET ([72.167.180.20]) with mapi; Fri, 15 Jul 2011 08:41:20 -0700
From: Eran Hammer-Lahav <eran@hueniverse.com>
To: Bob Van Zant <bob@veznat.com>, OAuth WG <oauth@ietf.org>
Date: Fri, 15 Jul 2011 08:41:02 -0700
Thread-Topic: [OAUTH-WG] OAuth v2-18 comment on "state" parameter
Thread-Index: AcxDBM7lJAeDhHG7TXeE2WExkZV3jQAAHb9w
Message-ID: <90C41DD21FB7C64BB94121FBBC2E7234501D6E020F@P3PW5EX1MB01.EX1.SECURESERVER.NET>
References: <CADrOfLJSd8Z=QfCcGUdFBU314rmjv9-u25Vta+ObXfNAwoA06w@mail.gmail.com>
In-Reply-To: <CADrOfLJSd8Z=QfCcGUdFBU314rmjv9-u25Vta+ObXfNAwoA06w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [OAUTH-WG] OAuth v2-18 comment on "state" parameter
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.12
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: Fri, 15 Jul 2011 15:41:35 -0000

I don't see the problem. The state value is percent-encoded both ways, so the only way to inject a bad value there is by including a value that has special meaning to the client. Putting a character limit on it will not do anything to prevent that.

The server should reject requests with query parameters that are not properly percent-encoded.

EHL

> -----Original Message-----
> From: oauth-bounces@ietf.org [mailto:oauth-bounces@ietf.org] On Behalf
> Of Bob Van Zant
> Sent: Friday, July 15, 2011 8:35 AM
> To: OAuth WG
> Subject: [OAUTH-WG] OAuth v2-18 comment on "state" parameter
> 
> Hi everyone,
> I'm in the process of implementing OAuth and I'm a little concerned about
> the "state" parameter that a client can send as part of the authorization
> request. The spec says that the value is opaque and that I need to accept,
> store, and reply with exactly what the client sent me. Can we impose some
> restrictions on the type of data a client can send?
> 
> The reason is that I don't necessarily trust the clients of my API to properly
> deal with sanitizing data. If someone steals a client_id (not
> hard) and puts something malicious into the state field I'll happily redirect the
> resource owner to my client's site with malicious data in state. If the client
> does not properly handle this malicious data (there's an established track
> record here) then I've opened my customer (the resource owner) to an
> attack.
> 
> Did I miss something in the spec where it limits what this variable can be? If
> not I'd like to propose that we limit this field to a set of characters that are
> safe. [a-zA-Z0-9_-]{0,100}
> 
> The authorization server would validate that the state field contains only
> those characters and if not SHOULD show the resource owner an error
> (consistent with section 4.1.2.1, paragraph 1 and others).
> 
> Thank you for all of your hard work on this spec to date and thanks for your
> consideration of my comments.
> 
> -Bob
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth