Project

General

Profile

Actions

Bug #1763

closed

SecurityError on an Exception object because of modification of instance variable #__ThrowState__

Added by nagai (Hidetoshi Nagai) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-07-08) [i686-linux]
Backport:
[ruby-dev:38760]

Description

=begin
以下ような例で,例外オブジェクトのインスタンス変数 (#ThrowState) 操作の
SecurityError となり,適切な例外状況を捉えることができません.

cmd = proc{p "cmd: safe_level == #{$SAFE}"; raise SystemExit}
safe0_p = proc{|*args| p args}

proc{
$SAFE = 4
begin
cmd.call
rescue SystemExit => e
safe0_p["SystemExit: #{e.inspect}"]
raise e
rescue Exception => e
safe0_p["Exception (NOT SystemExit): #{e.inspect}"]
raise e
end
}.call

vm.c の vm_exec() の中で設定しようとしているため,ユーザによる対処が極めて困難です.
例外オブジェクトに untrust 設定しようにも,
$SAFE==0 の cmd から見て外側の safe level は分かりませんから
untrust すべきかどうか判断できませんし,
その外側は $SAFE==4 ですので untrust 設定する権限がありません.
=end

Actions #1

Updated by yugui (Yuki Sonoda) over 14 years ago

  • Category set to YARV
  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)
  • Priority changed from Normal to 5
  • Target version set to 1.9.2

=begin

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24148.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0