Project

General

Profile

Actions

Bug #3733

closed

$SAFE==1環境下でtaintな文字列のFile.expand_path

Added by tdtds (Tadashi TADA) over 13 years ago. Updated about 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
1.9.2p0
Backport:
[ruby-dev:42089]

Description

=begin
ただただしです。

$SAFEが1な環境下で、taintな文字列をFile.expand_pathにかけると、
Insecure operationになります。1.8では発生しませんでした。

% ruby18 -ve '$SAFE=1;File.expand_path(".".taint)'
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]

% ruby19 -ve '$SAFE=1;File.expand_path(".".taint)'
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
-e:1:in expand_path': Insecure operation - expand_path (SecurityError) from -e:1:in '

意図したものかどうかわからなかったので、とりあえずBugで報告して
おきます。この影響でopen-uriが$SAFE=1では動かない場面が出ています。
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0