From c5497c7c670eb79e2c72668618e2426a56d7790e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 21 Apr 2011 20:00:27 +0200 Subject: [PATCH] [HttpFoundation] fixed a potential security problem in Request --- src/Symfony/Component/HttpFoundation/Request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index a2b964bd80..466236da67 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -311,7 +311,8 @@ class Request public function hasSession() { - return $this->cookies->has(session_name()); + // the check for $this->session avoids malicious users trying to fake a session cookie with proper name + return $this->cookies->has(session_name()) && null !== $this->session; } public function setSession(Session $session)