Explorar o código

Fix vulnerability of lack of token

Csrf\getError() returns null if there is no token field. As a result, the check is aborted without adding an error.
Visman %!s(int64=4) %!d(string=hai) anos
pai
achega
b3df3fc916
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Core/Validator.php

+ 1 - 1
app/Core/Validator.php

@@ -708,7 +708,7 @@ class Validator
             ! \is_string($value)
             || ! $this->c->Csrf->verify($value, $attr, $args)
         ) {
-            $this->addError($this->c->Csrf->getError(), 'e');
+            $this->addError($this->c->Csrf->getError() ?? 'Bad token', 'e');
 
             return null;
         } else {