Execution of OS command formed with user input detected.
- Rule ID: ruby_lang_exec_using_user_input
- Languages: ruby
- Source: exec_using_user_input.yml
Description
Applications should not execute OS commands that are formed from user input. This rule checks for external commands containing user-supplied data.
Remediations
❌ Avoid using user input when executing commands:
system(params[:command])
✅ Use user input indirectly when executing commands:
command =
case params[:action]
when "option1"
"command1"
when "option2"
"command2"
end
system(command)