Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93238 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60201 invoked from network); 11 May 2016 13:41:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 13:41:01 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.49 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.49 mail-oi0-f49.google.com Received: from [209.85.218.49] ([209.85.218.49:35360] helo=mail-oi0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/DC-28272-C6633375 for ; Wed, 11 May 2016 09:41:00 -0400 Received: by mail-oi0-f49.google.com with SMTP id x19so67664263oix.2 for ; Wed, 11 May 2016 06:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=YlIlgof0Yfc31KOed+sQN27zLHAYv/aGvmBXAJW6lHw=; b=o5qaX1oxLCojBh1NtUFZJarybFPUFSoyU84WGvvfrHH8hW9UOdbVm0qIEW4DLXLtaC 4r8GJnVlJZSfdfqMq1MsA4zKJS8X1xYl4ueF4Er6mkMdyDF2GRC8xiN+uzR+dv7v/yDS PPg1yrrg26h2gja4lle1xTQ0dz0wWrogZGnKo= 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:date :message-id:subject:from:to; bh=YlIlgof0Yfc31KOed+sQN27zLHAYv/aGvmBXAJW6lHw=; b=cHrWSrOxv5FEhpZOb4A3IxP0IMyqSHgoyAmQdzfi11Qk2sU1OT7lMWxvf3m5Auv5T5 8DhX+B3sf+RTbEqLVZ1SLqZlcFpjWyhkvZWrc0xAokfGB8rg3+e6fiNL8CeU/+x2UFM8 qys69rpaR5odTC7dRhKu1vnP+d5f31fwgL5swwHJFeKuEzHkCVmPiPcu7VziJ26W1Nk+ pviOgX/tbrjq9kPVaqS2BRGVTxkihm6HT9XyhKjBDLBY0mGY2ZcN1ZbK63xz1sZvvqh3 OftXSMzAZVrb8UhCQ/wczzRpiLfEEmbSKm76i79VjYW7mNJyMzYs4sApV8h1IUEXjXZi xGUA== X-Gm-Message-State: AOPr4FXZRmCnAxCw4QI0Bet07pN83Xe1HblbNxB8SqzXOnJS5wEQNaO5b+X+mqaCX6fsU/SV07AOwOQwfqe1tg== MIME-Version: 1.0 X-Received: by 10.157.63.70 with SMTP id m64mr2071255otc.170.1462974057613; Wed, 11 May 2016 06:40:57 -0700 (PDT) Received: by 10.202.175.147 with HTTP; Wed, 11 May 2016 06:40:57 -0700 (PDT) In-Reply-To: References: <3b115b37-d399-0b69-24b4-de5c95c4a069@gmail.com> <4667bb84-4401-4dd6-6193-fcf3aa6b3d48@gmail.com> <4d97846f-81d6-6cad-91ad-5e513a709e91@gmail.com> Date: Wed, 11 May 2016 16:40:57 +0300 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11472f2e053f820532913188 Subject: Re: [PHP-DEV] [RFC DRAFT] Automatic CSRF Protection From: narf@devilix.net (Andrey Andreev) --001a11472f2e053f820532913188 Content-Type: text/plain; charset=UTF-8 Hi, This gets a -1 from me as well. Much has been said already about why this is a bad idea, to the point where I don't know why there's still discussion around it. But here's one more reason ... It assumes, and thus also encourages, that users have an active session at all times - this is bad. You're not supposed to start a session for a user *until they have logged-in*. If you do, then unless you're not storing session data server-side (which is hard to do properly and is not supported by ext/session), you're almost certainly vulnerable to some form of DoS (e.g. inodes and/or memory/storage being filled-up), exhaustion of free IDs, entropy available for new session ID generation, pre-fetching of IDs to work around use_strict_mode restrictions, etc. Therefore, while the session store *after login* is suitable for token storage, CSRF protection by default just doesn't belong in ext/session. Cheers, Andrey. --001a11472f2e053f820532913188--