Permissive request parameters

Description

Allowing overly permissive request parameters can allow attackers to update any model attributes they choose.

Remediations

  • Do not use blanket permissions for request parameters. This approach can inadvertently expose your application to unauthorized modifications.
    params.permit! # unsafe
  • Do explicitly permit only the parameters that users are allowed to update. This practice helps safeguard your application by limiting what can be modified.
    params.permit(:name, :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=ruby_rails_permissive_parameters

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

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