From: ts Date: 2003-02-14T03:01:34+09:00 Subject: Re: mod_ruby insecury op >>>>> "D" == Daniel Carrera writes: D> Do something like: >> >> Probably you make confusion with another language D> Actually no, I'm not. From your previous message D> To untaint data you use regular expressions. In this case a directory D> name should only be composed of "word" charcaters and the character "/". D> Do something like: D> # dir tainted. D> if dir =~ /^([\w\/]+)$/ D> dir = $1 # Untainted. D> else D> # Error... D> end Now see the result D> # external data D> # ============= D> y1 = ENV["HOME"] D> y1.tainted? # -> true D> y2 = y1[2, 4] D> y2.tainted? # -> true D> y1 =~ /([a-z])/ D> $1.tainted? # -> true ^^^^^^^^^^^^^^^^^^^^^^^^^^ $1 is tainted Guy Decoux