Explorar el Código

[HttpFoundation] fixed a potential security problem in Request

Fabien Potencier hace 14 años
padre
commit
c5497c7c67
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/Symfony/Component/HttpFoundation/Request.php

+ 2 - 1
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)