Leakage of information in logger message

Description

Leaking data to loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of dynamic data or variables sent to loggers.

Remediations

❌ Avoid using variables or dynamic data in logger messages:

logger.info(f"User is: '{user.email}'")

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=go_lang_logger_leak

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=go_lang_logger_leak