Tcl Source Code

Artifact [cc35e8ac4d]
Login

Artifact cc35e8ac4d9f98e68d5de1a60efb75f917bae874a5b163959715a1c39597f3e2:

Ticket change [cc35e8ac4d] - Open ticket [21b0629c81fbe38a|21b0629c81]: <i>0-day vulnerability - insufficient escape by exec of batch-files for windows</i> plus 4 other changes by sebres 2018-08-30 18:26:26.
D 2018-08-30T18:26:26.240
J closer nobody
J icomment So\salthough\snow\sit\sis\sanyway\sbetter\sas\sit\spreviously\swas,\sthe\sstory\scontinues\s-\r\nthe\shandling\sround\sabout\spercent\scharacter\sis\sa\sbit\scomplex:\r\n<code><pre\sstyle="padding-left:10pt">\r\n%\sset\s::env(X)\s"simple-X";\sset\s::env("X")\s"quoted-X"\r\n%\sexec\stest-dump.cmd\s{%X%}\s{%"X"%}\s{"%X%"}\r\n\s\s\s\s`test-dump.exe´\s`quoted-X´\s`%"X"%´\s`"quoted-X"´\r\n</pre></code>\r\nSo\sthe\sescaped\ssequence\s<code>"%"X"%"</code>\scauses\sthat\sthis\stime\snot\svariable\s<code>X</code>\sbut\svariable\s<code>"X"</code>\swill\sbe\sinterpolated\sby\sthe\scommand\sprocessor.\r\n\r\n<sub>Thanks\sto\sEryk\sSun\s(@eryksun)\snoticed\sthis\sby\sthe\sfix\sfor\spython.</sub>\r\n\r\nSo\sthere\sare\sthree\spossible\sscenarios:<ol>\r\n<li>either\slet\sit\sas\sis\scurrently,\sso\sdon't\schange\ssomething\s(the\senvironment\svariable\sin\squotes\sis\svery\srare,\sbut\sanyway\sit\sis\sa\sbit\sugly\sas\s"good"\ssolution);\r\n</li><li>or\stry\sto\sfind\sbetter\sescape\shandling\s(I\sassume\spossible\sonly\sif\sit\swill\sbe\sescaped\sdifferently\sfor\sinvocation\sof\sexe\sand\scmd).\r\n</li><li>if\sthe\s"proper"\sescape\sof\s%-char\swill\sget\sstate\sas\sreally\simpossible\sor\svery\scomplex\s(so\scan\sbe\sdefined\sas\snot\sa\sbug\sbut\s"expected"\sfeature),\sso\slet\sit\sbe,\sbut\sat\sleast\sit\sbelongs\sdefinitely\sinto\sthe\sdocumentation\swith\ssome\sbold\swarning.\r\n</li></ol>\r\n\r\nSo\sI'm\sby\s2\sat\sthe\smoment,\sWiP.
J login sebres
J mimetype text/x-fossil-wiki
J status Open
K 21b0629c81fbe38ad153cd8fd899626200a66e15
U sebres
Z c0818bd8afa0cbba514e53c6e2fe4810