Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 92df7d6db77f2ddad728eae0060967e3584f729e
Ticket: 3027815fffffffffffffffffffffffffffffffff
Safe interpreters can use Thread to execute unsafe commands
User & Date: kjnash on 2010-07-10 15:26:41
Changes

  1. assignee changed to: "vasiljevic"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    A safe interpreter can load all the commands of the Thread package.  This is a security issue, because it means that a safe interpreter can create a new thread and send commands to that thread's unsafe master interpreter:
    
    % ::safe::interpCreate iSafe
    iSafe
    % iSafe eval pwd
    invalid command name "pwd"
    % iSafe eval {
        package require Thread
        set tid [thread::create]
        ::thread::send $tid {pwd}
    }
    /home/user
    %
    
    At present the safe entry point Thread_SafeInit gives a safe interpreter access to all the commands of the Thread extension.  For security reasons, at least some of these commands should be removed.
    
    Perhaps safe interpreters should not be allowed any access to Thread commands.  I am not familiar with the whole of the Thread package, but it appears that the natural scope of a thread operation is the master interpreter of the thread.  If a safe interpreter needs limited access to Thread commands, it might be best provided by wrapper commands aliased into the safe slave from its unsafe master - not by loading the Thread package itself.
    
    I suggest removing the safe entry point Thread_SafeInit completely.
    
    
  4. foundin changed to: "obsolete: 8.5.8"
  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: "kjnash"
  10. subsystem changed to: "80. Thread Package"
  11. title changed to:
    Safe interpreters can use Thread to execute unsafe commands
    
  12. type changed to: "Bug"