CakePHP Unsafe Configuration
ID |
php.cakephp_unsafe_configuration |
Severity |
high |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Misconfiguration |
Language |
Php |
Tags |
ASVS50:v6.5.6, ASVS50:v7.3.1, ASVS50:v7.4.1, ASVS50:v7.4.2, ASVS50:v7.4.3, ASVS50:v7.4.5, ASVS50:v7.6.1, ASVS50:v9.2.1, CWE:489, CWE:613, CakePHP, NIST.SP.800-53, OWASP:2025:A02, OWASP:2025:A07, PCI-DSS:6.5.6 |
Rationale
Some of the CakePhp configurations may lead to security vulnerabilities:
-
debug: When enabled it may lead to sensitive information exposure. -
Security.level: A low value may result into an excessive session timeout.
Here is a vulnerable code example for CakePHP:
<?php
use Cake\Core\Configure;
Configure::write('debug', 3); // FLAW
Configure::write('Security.level', 'low'); // FLAW
?>
In the code above, both debug and Security.level are not used properly.
Also, this is configurable in the config/app.php file for CakePHP:
<?php
return [
'debug' => true, // FLAW
'Security' => [
'salt' => '__SALT__',
'level' => 'low' // FLAW
],
];
Remediation
The sanitized version of the previous example would look like this:
<?php
return [
'debug' => false,
'Security' => [
'salt' => '__SALT__',
'level' => 'medium'
],
];