Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92217 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90999 invoked from network); 12 Apr 2016 11:01:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2016 11:01:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.68 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.68 mail-qg0-f68.google.com Received: from [209.85.192.68] ([209.85.192.68:34682] helo=mail-qg0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/C8-28094-4A5DC075 for ; Tue, 12 Apr 2016 07:01:57 -0400 Received: by mail-qg0-f68.google.com with SMTP id j35so1298357qge.1 for ; Tue, 12 Apr 2016 04:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PncFRsn9QR29hWiej79E4H6C3u4mNwKNs4oNKRhlwYo=; b=Zmj9pM2YW2QAafthGhUREo+2vdsWg5mtdR9h/FIV9MboHFyP9k5b97iaMWYnQDy799 UUC40l7b4mkBAmTVgEqrR7enWTunOf2Wp3Gkf9xhlIsmAshVrJcLdGJXdYEbfPU6V0I7 xDAw1Hz58Hh9Fe4f5RU6Q1kHKKuBwvdQXDgNfKYojASYHYD3zpJwHHm1eleK/LfEqw/K +cBfTtg5HI8rJfEXnanfeL2FIEhdajiWcusML+AMeJnZP/Nh9Tcfqbaef1RQ/9LRflB0 MJdIIg3bUwHrFeU+soH6ktQydAmup5sEuuixEmJ6OMmqIKQ3prhKTdX2hEtEfzZCPjWZ Sovw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PncFRsn9QR29hWiej79E4H6C3u4mNwKNs4oNKRhlwYo=; b=IO/SVd2Q6wQTkboMLYZXpyMRl4S9hYQ8tdY14cI6b/162psMNmP07Hnu38Bmi0VGGo PDW1IxGrdZ2Xqd+kLtyoWOa3aj8ZboRNuJiEpyHb3RrR9aNdhOeVjWwLah13wsy2ZRTv VXy88ppowH5vv2eOK2oZBFdsvYT3FO7WIrQNiAjz512je/EEA8Bsq0muJ2i1Kg0GfxqH ieFEkOhqXig2P0/NwoZMmxlocZdQRqOd68enXBwoI9IcNJw/mTG2wHu54xQ2+5AeNtVx f/KChpTbC4l7j6HjknRyOV+62VP+0e/FaJ8n3wvyU62eaLCCTrEzUy9FMwmDERsh279S j4vw== X-Gm-Message-State: AOPr4FVkdsOGYbVCe2By/LKQTeNmLECzErmdXHKETCNMk+do7RY7qh7/JIFdIQU6TXDUHCE+fHoDk7LKHVPbfw== X-Received: by 10.140.215.2 with SMTP id l2mr3166603qhb.26.1460458914235; Tue, 12 Apr 2016 04:01:54 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.140.39.175 with HTTP; Tue, 12 Apr 2016 04:01:14 -0700 (PDT) In-Reply-To: <570CB007.2080503@php.net> References: <5706EEF3.3050705@gmail.com> <570CB007.2080503@php.net> Date: Tue, 12 Apr 2016 20:01:14 +0900 X-Google-Sender-Auth: h22KF56c3QMIPr_CZR225qsj4PU Message-ID: To: Michael Wallner Cc: Stanislav Malyshev , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Session ID without hashing From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Michael, On Tue, Apr 12, 2016 at 5:21 PM, Michael Wallner wrote: >> PRNG like /dev/urandom is supposed to be secure, but fair point. It >> may be good idea keeping old hash based session ID just in case >> someone find vulnerability. I suppose it's unlikely with modern PRNGs, >> though. > > I've come to think that "unlikely" is still a bad precondition with > regards to security... :) Yes. Almost all of crypt relies on "unlikely", though. So issue is how "unlikely" it is. I suppose almost all crypt experts agree /dev/urandom and friends are secure enough. (Except side channel attacks) >> If we have to care about PRNG state exposure, code may be changed to >> read random length from RPNG. This would be good enough mitigation. I >> would like to hear from PRNG experts if this is good enough. (or not >> needed) >> >>> Second, I do not see why we need to do maximum >>> breakage change if we could just make an identity "hash" function and >>> support both cases. "Session generation performance" does not have a lot >>> of meaning here - I'd be very surprised to see any application that is >>> bound by the speed of generating session IDs. >> >> w/ Patch: Requests per second: 2278.59 [#/sec] (mean) >> w/o Patch: Requests per second: 899.36 [#/sec] (mean) >> (This is CLI server and "ab -c 20 -n 100000" result on Core i7 4770s Linux) >> >> I didn't expect this much difference, but this is the result. Since >> security experts advise to change session ID relatively high frequency >> (few minutes to half an hour), this difference may be noticeable apps >> returning cached JSON. I know apps that change session ID on every >> request. (This should be done with caution. Otherwise, you may >> experience lost sessions a lot due to race conditions) Such apps will >> see performance gain. > > This RPS change is the result of just omitting hashing of the session id? and changes "session.use_strict_mode" default INI value to 1. I haven't added code to read random length from PRNG also. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net