Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93185 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49613 invoked from network); 11 May 2016 01:21:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 01:21:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=kinncj@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kinncj@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.42 as permitted sender) X-PHP-List-Original-Sender: kinncj@gmail.com X-Host-Fingerprint: 209.85.192.42 mail-qg0-f42.google.com Received: from [209.85.192.42] ([209.85.192.42:32914] helo=mail-qg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/6F-63163-A0982375 for ; Tue, 10 May 2016 21:21:14 -0400 Received: by mail-qg0-f42.google.com with SMTP id f92so16669111qgf.0 for ; Tue, 10 May 2016 18:21:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LJO2Li+6C9DD6+X5WgyxLkt3bMHLypwF8+hhWioUvn4=; b=iwBDgMXnZBb37UfgXgOR+ea9eVH6BID4iye6xGPwfdYHh010du5idXYJeNNamh9f4J sex3OVWFP0FOUYvnzIwYrA3lskbGkc5zAyFS1tqOsdXjf0UIhZTMZZGr3urgtt++fY4u 7vahFSiIEByzTjpnBE+uPAI4FdPZMi31/ylwKYPR+/jiKVcyn1T+eTFLOLx0ZYIZA5zC PJVUwHeAP6n2VM2nrDod1BLxtfGfRbNleDxJoRA5V7Npll3enHDmPCE6vpysobvbKIYf zh6RAl1weXULwb2HzzDLT7u6zryws7htuHjq+1Hl1h8Ik0zaSPChZROMzlkg+YJ2qCtj u+tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LJO2Li+6C9DD6+X5WgyxLkt3bMHLypwF8+hhWioUvn4=; b=OgQ2JqXPBVEH1+UttVP++11eierpCzL7ATVKEv17V0u8Dj4PApZWfoqnqkLOh3246G GpDw0p9yotA1ZOPZgVkxJRg5BKvg2w92M/d9QN1nSzw4nLqu7vFxQCLJf1Mxyl7Umcwb UU6f/T8iYgNvDnSjVJtde4NfPJISVaQBS9WK+b4PVqY0Y7VSivXG0A+XiA8u/X2WPg3s WrG1iSFWaS1HJXlzy5HKTmAH3zcsmQZ9uK84Rd5bVCwlzp8QOi+5NHUhbmSSOqwA+Mok t5UFGPBs4zU6ySNrZZoSZ71ws1V7myBYJyNKA/c3dyLNpUu4tjjVN2hwvBNLJob1IknV uuAw== X-Gm-Message-State: AOPr4FVGlpFHHm8YNFG98GPqz500ks7T92QXTP2a+MC0vdFzS2MUze4cnTya8DdRjukOHpM5hVxyHn1wyktafg== X-Received: by 10.140.107.70 with SMTP id g64mr596430qgf.43.1462929672382; Tue, 10 May 2016 18:21:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.36.147 with HTTP; Tue, 10 May 2016 18:20:52 -0700 (PDT) In-Reply-To: References: <3b115b37-d399-0b69-24b4-de5c95c4a069@gmail.com> Date: Tue, 10 May 2016 21:20:52 -0400 Message-ID: To: Yasuo Ohgaki Cc: Stanislav Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113a6c04742f8e053286db2a Subject: Re: [PHP-DEV] [RFC DRAFT] Automatic CSRF Protection From: kinncj@gmail.com (=?UTF-8?B?S2lubiBKdWxpw6Nv?=) --001a113a6c04742f8e053286db2a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > JS code that does not have pages at all may obtain CSRF token manually. That's against CSRF protection... in fact, a remote app can obtain the token also and make the cross site request forgery... -1 On Tue, May 10, 2016 at 9:17 PM, Yasuo Ohgaki wrote: > Hi Stas, > > On Wed, May 11, 2016 at 7:58 AM, Stanislav Malyshev > wrote: > >>> Add where? And where that value would come from? RFC says nothing abo= ut > >>> that. > >> > >> As usual. Query parameter when GET is used. Additional input when POST > >> is used. All users have to do is adding CSRF token to JS program. > > > > GET and POST aren't the only HTTP methods. And where JS program would > > get the correct token from? As far as I can see, there's no function in > > the RFC that produces it. > > JS code that does not have pages at all may obtain CSRF token manually. > > get_csrf_token.php > session_start(['csrf_protection'=3D>SESSION_CSRF_GET]); > echo json_encode(['SESSCSRF'=3D>SESSCSRF]); > ?> > > then JS apps may use the token. Users must be careful for CSRF token TTL. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 *--* *Kinn Coelho Juli=C3=A3o* *Toronto - ON/Canada* --001a113a6c04742f8e053286db2a--