Skip to content
Tcl Source Code History Of Ticket 2000565fffffffff
Login

History Of Ticket 2000565fffffffff

Artifacts Associated With Ticket 2000565fffffffff

  1. Ticket change [330b2300ab] (rid 106515) by lars_h on 2008-06-23 08:06:51:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "obsolete: 8.5.2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "lars_h"
    10. subsystem initialized to: "20. [interp]"
    11. title initialized to: "return -level not caught at safe interp boundary"
    12. type initialized to: "Bug"
  2. Ticket change [7dd08e5f4e] (rid 97298) by dkf on 2008-06-23 15:12:25:

    1. assignee changed to: "dgp"
    2. priority changed to: "8"
  3. Ticket change [61ef16da8b] (rid 92326) by dgp on 2008-06-23 21:34:13:

    1. closedate changed to: "2008-06-23T14:34:13"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      Adding [return -level] did not add
      any new security concerns.  Tcl 8.4
      already had [return -code return]:
      
      % info patch
      8.4.19
      % interp create slave
      slave
      % catch {slave eval {return -code return}} m
      2
      
      If you permit a slave interp to evaluate
      an unknown, untrusted script, you must
      [catch] the evaluation, and be prepared to
      handle any return code it might throw back
      at you.  That's been true as long as there
      have been slave interps.
      
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "dgp"