Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

guide · Ruby 3.3

Command Injection

Some Ruby core methods accept string data that includes text to be executed as a system command.

They should not be called with unknown or unsanitized commands.

These methods include:

Note that some of these methods do not execute commands when called from subclass File:

From doc/command_injection.rdoc in Ruby 3.3. View on GitHub ↗ docs.ruby-lang.org ↗