Artifacts Associated With Ticket 2917673fffffffff
Ticket change [2b305e1630] (rid 118700) by johannes-kuhn on 2009-12-19 16:03:05:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
According to the documentation, Safe Base should not allow subdirectory access. > The only valid file names arguments for the source and load aliases provided to the slave are path in the form of [file join token filename] (i.e. when using the native file path formats: token/filename on Unix and token\filename on Windows), where token is representing one of the directories of the accessPath list and filename is one file in that directory (no sub directories access are allowed). But this breaks the loading of Tcl modules (tm) with a ::, (the :: is translated to the directory separator). So nested directories have been allowed for source, load, and glob. But for the normal auto_path, witch search also in subdirectories, we add each subdirectory into the accessPath and forbid the search for pkgIndex.tcl, so we don't have the same package 2 times. I think this is not a good approach. I think, we should general allow that subdirectories can be searched
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "johannes-kuhn"
- subsystem initialized to: "33. Safe Base"
- title initialized to: "Behavior"
- type initialized to: "Bug"
Ticket change [4d2ae3778c] (rid 127018) by johannes-kuhn on 2009-12-19 23:03:51:
- priority changed to: "3 Low"
- title changed to: "Behavior of Safe Base"
Ticket change [27df495745] (rid 88599) by dkf on 2012-05-31 16:38:09:
- assignee changed to: "dkf"
- foundin changed to: "obsolete: 8.5.11"
- icomment:
Is this an issue with the current tip of the core-8-5-branch or the trunk?
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [26f0e74c39] (rid 88435) by dkf on 2012-05-31 16:39:07:
- icomment:
I ask because I've been working in this area, and I think I may have cleaned up a lot of the horrible problems in the area. Or I might've made some silly blunder. :-)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [159c0fedd1] (rid 124598) by johannes-kuhn on 2012-05-31 19:00:57:
- icomment:
This is more or less a general problem, introduced with safe base's compatibility for tm packages, that have never been solved. Currently a problem is that you could load a tm module called tcl::chan::fifo as chan::fifo. That means there are the following problems: 1) The same file can be accessed by different paths, like $p(:0:)/foo/bar.tcl and $p(:1:)/bar.tcl This means that the directory structure is not protected. 2) If I want to allow a safe interp to access a given directory, I usually need [file] (no problem, the new have to be compatible with the normal safe [file] command), [open] (not exposed) and [glob]. Writing a compatible [glob] is only possible with introspection ([interp alias $slave glob]) or other complex techniques. I see 2 possible solutions: 1) TM modules could be searched by the parent. This means that non-tm modules can only be loaded if they are in the access path. This is also what the documentation states. In this approach, [glob] is not longer needed in the safe base. 2) expose the entire directory structure. I have written such a replacement for the safe base, the api is not complete yet, but I'm already using it productive. http://johannes13.de/svn/john-tools/safe.tcl It is broken on Tcl 8.6b2.
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [b2eb05755b] (rid 185049) by kjnash on 2020-07-20 23:53:36:
- closer changed to: "nobody"
- comment changed to:
According to the documentation, Safe Base should not allow subdirectory access. > The only valid file names arguments for the source and load aliases provided to the slave are path in the form of [file join token filename] (i.e. when using the native file path formats: token/filename on Unix and token\filename on Windows), where token is representing one of the directories of the accessPath list and filename is one file in that directory (no sub directories access are allowed). But this breaks the loading of Tcl modules (tm) with a ::, (the :: is translated to the directory separator). So nested directories have been allowed for source, load, and glob. But for the normal auto_path, witch search also in subdirectories, we add each subdirectory into the accessPath and forbid the search for pkgIndex.tcl, so we don't have the same package 2 times. I think this is not a good approach. I think, we should general allow that subdirectories can be searched
- icomment:
I believe this problem was solved a while ago (by dkf's safe::AliasGlob). The de-fanged glob used in Safe Base interpreters can see files in a subdirectory of an access-path directory, but only if the subdirectory is itself a part of the access path. The report is correct that <verbatim> 1) The same file can be accessed by different paths, like $p(:0:)/foo/bar.tcl and $p(:1:)/bar.tcl This means that the directory structure is not protected. </verbatim> There is a little leakage of information - in this example the safe interpreter can figure out that directory {$p(:0:)/foo} is tokenized as {$p(:1:)}; but this information does not appear to pose a security risk, and is inevitable if Safe Base interpreters are to have access to modules. <verbatim> 2) If I want to allow a safe interp to access a given directory, I usually need [file] (no problem, the new have to be compatible with the normal safe [file] command), [open] (not exposed) and [glob]. Writing a compatible [glob] is only possible with introspection ([interp alias $slave glob]) or other complex techniques. </verbatim> The safe::AliasGlob command now does most of its analysis in the master interpreter, and is careful to ensure that both the arguments supplied by the safe interpreter, and the result returned to it, belong to the interpreter's access path. <verbatim> Currently a problem is that you could load a tm module called tcl::chan::fifo as chan::fifo. </verbatim> This problem is fixed in [951cd4cdfa7e1]. Does this resolve the bug report? - login: "kjnash"
- mimetype: "text/x-fossil-wiki"
- severity changed to: "Minor"
Ticket change [d8f8b4cb98] (rid 190588) by kjnash on 2020-12-31 15:59:20:
- closedate changed to: "2459215.16621447"
- closer changed to: "kjnash"
- login: "kjnash"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"