Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96167 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7288 invoked from network); 26 Sep 2016 23:10:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2016 23:10:00 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:50424] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/36-04248-6CAA9E75 for ; Mon, 26 Sep 2016 19:09:59 -0400 Received: (qmail 102006 invoked by uid 89); 26 Sep 2016 23:09:55 -0000 Received: from unknown (HELO mail-qt0-f173.google.com) (yohgaki@ohgaki.net@209.85.216.173) by 0 with ESMTPA; 26 Sep 2016 23:09:55 -0000 Received: by mail-qt0-f173.google.com with SMTP id 38so91406637qte.1 for ; Mon, 26 Sep 2016 16:09:55 -0700 (PDT) X-Gm-Message-State: AA6/9RlUmgfPFAaOx2sXuodvDMDRImZfUXtEa3dizXMMj8xd4Nl0+eUwseAfrnzRIbKgwmwmsmrGzHYzRa4SqQ== X-Received: by 10.237.47.162 with SMTP id m31mr24727859qtd.55.1474931389561; Mon, 26 Sep 2016 16:09:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.84.168 with HTTP; Mon, 26 Sep 2016 16:09:09 -0700 (PDT) In-Reply-To: <327bf6ed-cd4a-dd4a-3d77-5a79e645d2d6@gmail.com> References: <327bf6ed-cd4a-dd4a-3d77-5a79e645d2d6@gmail.com> Date: Tue, 27 Sep 2016 08:09:09 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Fixing halfway implemented session management - timestamp based session management OR remove session_regenerate_id() From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Rowan, On Tue, Sep 27, 2016 at 3:02 AM, Rowan Collins wrote: > On 26/09/2016 07:02, Stanislav Malyshev wrote: >>> >>> http://php.net/manual/en/session.security.php >>> >http://php.net/manual/en/function.session-regenerate-id.php >> >> It looks like those need some polishing. If somebody with native English >> volunteers it'd be great, otherwise I'll do it a bit later. > > > I was about to make the same comment. I'm sure there are some very important > points in here, but it's quite hard to follow. For instance, the section > "Non-Adaptive Session Management" jumps straight in with the claim that > "PHP's session manager is adaptive by default", but never explains, as far > as I can see, what that actually means. There's also far too many Warning > and Note pop-outs on that page - the whole page is security advice, does it > really make sense to colour every other paragraph pink? > > I think a better approach for both the manual and RFCs proposing changes is > to try to summarise the key attacks users need to protect against, and how > to protect against them (as well as some of the trade-offs involved). > Perhaps then an additional summary at the end with the recommended > combination of settings. Use bullet points, summary sentences, etc. > > I've probably got some details wrong here, but just as an example of the > style: > > Session Hijacking > =============== > > Session Hijacking is one of the simplest session-related attacks: an > attacker accesses the website using another user's session. This can lead to > problems such as: > > - The attacker impersonating a known user. > - The attacker gaining access to restricted parts of a site. > - The attacker accessing the user's personal details stored on the server > (e.g. a "My Account" or "My Orders" page) > > To protect against session hijacking, you should: > > - Restrict the places the session ID appears. For instance, set the session > manager to use HTTP-only cookies, and no URL rewriting. > - Verify that the same user is accessing the session on each request. For > instance, store "fingerprint" details such as User Agent and discard the > session if it changes. > - ... > > Session Fixation > ============== > > Session Fixation is similar to Session Hijacking, but rather than > discovering the user's session ID, the attacker chooses a new session ID and > tricks the application into using that session ID. > > ... and so on ... Thank you. I assumed that readers have basic web security knowledge, but I shouldn't. I'll try to improve, but feel free to correct/improve it directly. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net