Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 330b2300ab52701039556faa3a53a0f10ea9771d
Ticket: 2000565fffffffffffffffffffffffffffffffff
return -level not caught at safe interp boundary
User & Date: lars_h on 2008-06-23 08:06:51
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    It seems the -level option of [return] has the power to cross interpreter boundaries, even that from a safe interpreter to its master:
    
    % info patchlevel
    8.5.2
    % interp create -safe test
    test
    % catch {test eval {return -level 3 foo}} res info
    2
    % set res
    foo
    % set info
    -code 0 -level 2
    
    Doesn't this constitute a security hole? If we have a proc like
    
    proc eval_and_check {script} {
       set res [interp slave eval $script]
       validate_res_allowed $res
       return $res
    }
    
    then the $script can fool the caller of [eval_and_check] to accept anything by [return]ing it at the level of [eval_and_check].
    
    
    
  4. foundin changed to: "obsolete: 8.5.2"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "lars_h"
  10. subsystem changed to: "20. [interp]"
  11. title changed to: "return -level not caught at safe interp boundary"
  12. type changed to: "Bug"