Sensitive data in a logger message detected.
- Rule ID: php_third_parties_logger
- Languages: php
- Source: logger.yml
Leaking sensitive data to loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to loggers.
❌ Avoid using sensitive data in logger messages:
$log->info('User is: ' . $user.email)
✅ If you need to identify a user, ensure to use their unique identifier instead of their personal identifiable information:
log->info('User is: ' . $user.uuid)
- CWE-209: Generation of Error Message Containing Sensitive Information
- CWE-532: Insertion of Sensitive Information into Log File
OWASP Top 10
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=php_third_parties_logger
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=php_third_parties_logger
Ready to take the next step? Learn more about Bearer Cloud.