Tcl Source Code

View Ticket
Login
Ticket UUID: ba3a158b5210723a51c468e086804d1189f70752
Title: Additional commands to be disabled in safe interps
Type: Bug Created on: 2024-08-04 03:29:58
Submitter: apnadkarni Assigned to: nobody
Subsystem: - New Builtin Commands Severity: Important
Priority: 5 Medium Last modified: 2024-08-04 03:29:58
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 9.0
Description:
% interp create -safe ip
ip
% ip eval {info hostname}
io
% ip eval {info loaded}
{//zipfs:/lib/tcl/tcl_library/registry/tcl9registry13.dll Registry}

info loaded should not be permitted for the same reason info nameofexecutable is currently not allowed - it reveals file system information. info script might fall into the same category but need to check if it already obfuscates file paths when source is exposed to a safe interpreter, for example via SafeBase.

info hostname is perhaps debatable. It is part of a larger set that leak information about the host system OS and arch (tcl_platform, info pathseparator etc.). Should all these be blocked in a safe interpreter?