Use of reflection influenced by user input detected.
- Rule ID: ruby_lang_reflection_using_user_input
- Languages: ruby
- Source: reflection_using_user_input.yml
Description
Applications should not look up or manipulate code using user-supplied data.
Remediations
❌ Avoid using user input when using reflection:
method(params[:method])
✅ Use user input indirectly when using reflection:
method_name =
case params[:action]
when "option1"
"method1"
when "option2"
"method2"
end
method(method_name)