Re: [OAUTH-WG] state parameter and XSRF detection

Marius Scurtescu <mscurtescu@google.com> Mon, 27 June 2011 21:49 UTC

Return-Path: <mscurtescu@google.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 7F77B11E815E for <oauth@ietfa.amsl.com>; Mon, 27 Jun 2011 14:49:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.977
X-Spam-Level:
X-Spam-Status: No, score=-105.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 duG8S3HbKLMM for <oauth@ietfa.amsl.com>; Mon, 27 Jun 2011 14:49:04 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by ietfa.amsl.com (Postfix) with ESMTP id AA8CE11E8156 for <oauth@ietf.org>; Mon, 27 Jun 2011 14:49:03 -0700 (PDT)
Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id p5RLn16S007872 for <oauth@ietf.org>; Mon, 27 Jun 2011 14:49:02 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1309211342; bh=M0x9DeL1m9oi7Txx3LbivXHV/xI=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding; b=ti1TrTV4jGb+rqPVW5dQJQvbgrzaf3sfs2Xbr4EhPMPODAFutjXuQi/9JeCVXb7N3 8inCfEEBiVRWb8n4X/a3w==
Received: from qwa26 (qwa26.prod.google.com [10.241.193.26]) by kpbe14.cbf.corp.google.com with ESMTP id p5RLl7RR012290 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <oauth@ietf.org>; Mon, 27 Jun 2011 14:49:00 -0700
Received: by qwa26 with SMTP id 26so3391861qwa.0 for <oauth@ietf.org>; Mon, 27 Jun 2011 14:49:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=BkovV2zjm6Ii3N1CnzvRi/w57HZq0Xc8HTsf7Kf5f0s=; b=dKAZei0ocsCF7ERGEpBiEJ2wLT+SLDIzqgIKonvatCRNqKsZoyVMVHm1pCOXj9KNlB ExKf5tvkzr8MzM2h3GvA==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=fHpRoPrLrGsQsvh0nXSFcq/nFUZsEDOKyTQ5aCa7wt+dM/mdslcKB6zHiGiir+q82x i1ztld/GNNnb61BmAQpA==
Received: by 10.229.46.149 with SMTP id j21mr4955947qcf.294.1309211340135; Mon, 27 Jun 2011 14:49:00 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.6.133 with HTTP; Mon, 27 Jun 2011 14:48:40 -0700 (PDT)
In-Reply-To: <4E08F494.2010807@lodderstedt.net>
References: <4E08F494.2010807@lodderstedt.net>
From: Marius Scurtescu <mscurtescu@google.com>
Date: Mon, 27 Jun 2011 14:48:40 -0700
Message-ID: <BANLkTin+0WvUXLApWJdKsMutSmhaQHxqO3U90bPHL=RWNdzeuw@mail.gmail.com>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-System-Of-Record: true
Cc: OAuth WG <oauth@ietf.org>
Subject: Re: [OAUTH-WG] state parameter and XSRF detection
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: Mon, 27 Jun 2011 21:49:04 -0000

On Mon, Jun 27, 2011 at 2:22 PM, Torsten Lodderstedt
<torsten@lodderstedt.net> wrote:
> Hi all,
>
> while working on a new revision of the OAuth security document, a question
> arose I would like to clarify on the list.
>
> The "state" parameter is supposed to be used to link a certain authorization
> request and response. Therefore, the client stores a value in this parameter
> that is somehow bound to a value retained on the device (the user agent)
> originating the authorization request.
>
> The question now is: Would it be compliant with the core spec to use any
> other URI query parameter encoded in the redirect_uri, instead of the
> "state" parameter, to achieve the same goal? Probably the client already has
> a working "legacy" implementation it does not want to change just for OAuth2
> compliance.
>
> According to section 2.2.1, the redirection uri could contain a dynamic
> portion:
>
> "The authorization server SHOULD require the client to pre-register
>   their redirection URI or at least certain components such as the
>   scheme, host, port and path"
>
> So this should be fine.
>
> Any comments?

It all depends on the authorization server. For example, currently
Google does strict matching on the redirect URI, so you must use
"state".

I think "state" is the only safe, portable option. Unless the OAuth 2
spec dictates how URI matching should be done.

Marius


>
> regards,
> Torsten.
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>