[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / doc / command_injection.rdoc
blobee33d4a04e662923ba2d232f0612c3d37c25382f
1 = Command Injection
3 Some Ruby core methods accept string data
4 that includes text to be executed as a system command.
6 They should not be called with unknown or unsanitized commands.
8 These methods include:
10 - Kernel.exec
11 - Kernel.spawn
12 - Kernel.system
13 - {\`command` (backtick method)}[rdoc-ref:Kernel#`]
14   (also called by the expression <tt>%x[command]</tt>).
15 - IO.popen (when called with other than <tt>"-"</tt>).
17 Some methods execute a system command only if the given path name starts
18 with a <tt>|</tt>:
20 - Kernel.open(command).
21 - IO.read(command).
22 - IO.write(command).
23 - IO.binread(command).
24 - IO.binwrite(command).
25 - IO.readlines(command).
26 - IO.foreach(command).
27 - URI.open(command).
29 Note that some of these methods do not execute commands when called
30 from subclass +File+:
32 - File.read(path).
33 - File.write(path).
34 - File.binread(path).
35 - File.binwrite(path).
36 - File.readlines(path).
37 - File.foreach(path).