Skip to content
Tcl Source Code Artifact [b2eb05755b]
Login

Artifact [b2eb05755b]

Artifact b2eb05755bf1fd7518216cfcf908a696a0ba445487eb2980a616f77ac0165de8:

Ticket change [b2eb05755b] - Ticket [2917673fffffffff|2917673fff] <i>Behavior of Safe Base</i> status still Open with 6 other changes by kjnash on 2020-07-20 23:53:36.
D 2020-07-20T23:53:36.238
J closer nobody
J comment According\sto\sthe\sdocumentation,\sSafe\sBase\sshould\snot\sallow\ssubdirectory\saccess.\r\n>\sThe\sonly\svalid\sfile\snames\sarguments\sfor\sthe\ssource\sand\sload\saliases\sprovided\sto\sthe\sslave\sare\spath\sin\sthe\sform\sof\s[file\sjoin\stoken\sfilename]\s(i.e.\swhen\susing\sthe\snative\sfile\spath\sformats:\stoken/filename\son\sUnix\sand\stoken\\filename\son\sWindows),\swhere\stoken\sis\srepresenting\sone\sof\sthe\sdirectories\sof\sthe\saccessPath\slist\sand\sfilename\sis\sone\sfile\sin\sthat\sdirectory\s(no\ssub\sdirectories\saccess\sare\sallowed).\r\n\r\nBut\sthis\sbreaks\sthe\sloading\sof\sTcl\smodules\s(tm)\swith\sa\s::,\s(the\s::\sis\stranslated\sto\sthe\sdirectory\sseparator).\r\n\r\nSo\snested\sdirectories\shave\sbeen\sallowed\sfor\ssource,\sload,\sand\sglob.\r\n\r\nBut\sfor\sthe\snormal\sauto_path,\switch\ssearch\salso\sin\ssubdirectories,\swe\sadd\seach\ssubdirectory\sinto\sthe\saccessPath\sand\sforbid\sthe\ssearch\sfor\spkgIndex.tcl,\sso\swe\sdon't\shave\sthe\ssame\spackage\s2\stimes.\r\n\r\nI\sthink\sthis\sis\snot\sa\sgood\sapproach.\r\n\r\nI\sthink,\swe\sshould\sgeneral\sallow\sthat\ssubdirectories\scan\sbe\ssearched
J icomment I\sbelieve\sthis\sproblem\swas\ssolved\sa\swhile\sago\s(by\sdkf's\ssafe::AliasGlob).\s\sThe\sde-fanged\sglob\sused\sin\sSafe\sBase\sinterpreters\scan\ssee\sfiles\sin\sa\ssubdirectory\sof\san\saccess-path\sdirectory,\sbut\sonly\sif\sthe\ssubdirectory\sis\sitself\sa\spart\sof\sthe\saccess\spath.\r\n\r\nThe\sreport\sis\scorrect\sthat\r\n<verbatim>\r\n\s\s\s1)\sThe\ssame\sfile\scan\sbe\saccessed\sby\sdifferent\spaths,\slike\s$p(:0:)/foo/bar.tcl\sand\s$p(:1:)/bar.tcl\r\nThis\smeans\sthat\sthe\sdirectory\sstructure\sis\snot\sprotected.\r\n</verbatim>\r\n\r\nThere\sis\sa\slittle\sleakage\sof\sinformation\s-\sin\sthis\sexample\sthe\ssafe\sinterpreter\scan\sfigure\sout\sthat\sdirectory\s{$p(:0:)/foo}\sis\stokenized\sas\s{$p(:1:)};\sbut\sthis\sinformation\sdoes\snot\sappear\sto\spose\sa\ssecurity\srisk,\sand\sis\sinevitable\sif\sSafe\sBase\sinterpreters\sare\sto\shave\saccess\sto\smodules.\r\n\r\n<verbatim>\r\n\s\s\s2)\sIf\sI\swant\sto\sallow\sa\ssafe\sinterp\sto\saccess\sa\sgiven\sdirectory,\sI\susually\sneed\s[file]\s(no\sproblem,\sthe\snew\shave\sto\sbe\scompatible\swith\sthe\snormal\ssafe\s[file]\scommand),\s[open]\s(not\sexposed)\sand\s[glob].\sWriting\sa\scompatible\s[glob]\sis\sonly\spossible\swith\sintrospection\s([interp\salias\s$slave\sglob])\sor\sother\scomplex\stechniques.\r\n</verbatim>\r\n\r\nThe\ssafe::AliasGlob\scommand\snow\sdoes\smost\sof\sits\sanalysis\sin\sthe\smaster\sinterpreter,\sand\sis\scareful\sto\sensure\sthat\sboth\sthe\sarguments\ssupplied\sby\sthe\ssafe\sinterpreter,\sand\sthe\sresult\sreturned\sto\sit,\sbelong\sto\sthe\sinterpreter's\saccess\spath.\r\n\r\n<verbatim>\r\n\s\s\s\sCurrently\sa\sproblem\sis\sthat\syou\scould\sload\sa\stm\smodule\scalled\stcl::chan::fifo\sas\schan::fifo.\r\n</verbatim>\r\n\r\nThis\sproblem\sis\sfixed\sin\s[951cd4cdfa7e1].\r\n\r\nDoes\sthis\sresolve\sthe\sbug\sreport?
J login kjnash
J mimetype text/x-fossil-wiki
J severity Minor
K 2917673fffffffffffffffffffffffffffffffff
U kjnash
Z 1e59e380d20939f2cf917e972895c897