Skip to content

Bug: Argument 1 passed to CodeIgniter\Security\Security::derandomize() must be of the type string, null given, called in /home/system/Security/Security.php on line 284 #5741

Closed
@stresbiz

Description

@stresbiz

PHP Version

7.4

CodeIgniter4 Version

4.1.8

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

apache

Database

No response

What happened?

Receiving this critical error for CSRF:

CRITICAL - 2022-02-24 09:54:04 --> Argument 1 passed to CodeIgniter\Security\Security::derandomize() must be of the type string, null given, called in /home/system/Security/Security.php on line 284
#0 /home/system/Security/Security.php(284): CodeIgniter\Security\Security->derandomize(NULL)
#1 /home/system/Filters/CSRF.php(53): CodeIgniter\Security\Security->verify(Object(CodeIgniter\HTTP\IncomingRequest))
#2 /home/system/Filters/Filters.php(173): CodeIgniter\Filters\CSRF->before(Object(CodeIgniter\HTTP\IncomingRequest), NULL)
#3 /home/system/CodeIgniter.php(386): CodeIgniter\Filters\Filters->run('search', 'before')
#4 /home/system/CodeIgniter.php(320): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#5 /home/public/index.php(37): CodeIgniter\CodeIgniter->run()

Steps to Reproduce

It looks like when you set public $tokenRandomize = true in Security.php config, this error occurs.

LINE: /system/Security/Security.php on line 284
$token = $this->tokenRandomize ? $this->derandomize($this->getPostedToken($request))

Expected Output

N/A

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions