Unsanitized user input in code generation

Description

Applications should not look up or manipulate code using user-supplied data.

Remediations

❌ Avoid using user input when using reflection:

$class = new ReflectionClass($_GET["class"])

Resources

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=php_lang_reflection_using_user_input

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

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