I'm working on a legacy rails application and the controllers have many instances of params.permit!
. When running a Brakeman scan on it, params.permit!
opens up the application to mass assignment vulnerabilities.
My question is- what is the most effective way to get around this params.permit! vulnerability and replace it?
params.permit!
whitelists all attributes leading to the vulnerabilities of mass assignment. The best way to get around this is by whitelisting only the necessary attributes like soEven better, use
require
withpermit