Do not use user input with FTP.
- Rule ID: ruby_lang_ftp_using_user_input
- Languages: ruby
- Source: ftp_using_user_input.yml
Using raw unsanitized input with FTP methods is bad practice. It could put your application at risk for code injection attacks, or lead to path traversal, by which attackers can gain access to resources outside of the intended scope
❌ Do not form filenames or file paths for FTP from raw user input
❌ Do not pass raw user input as arguments to FTP methods
Net::FTP.open("example.txt", username: params[:user]) do