Skip to content
Tcl Source Code Artifact [934236ce4b]
Login

Artifact [934236ce4b]

Artifact 934236ce4b284ff968784e0257267632428280a929a01266fcd60b69c7e21fb9:

Ticket change [934236ce4b] - Ticket [21b0629c81fbe38a|21b0629c81] <i>0-day vulnerability - insufficient escape by exec of batch-files for windows</i> status still Open with 3 other changes by sebres on 2023-11-16 14:15:48.
D 2023-11-16T14:15:48.063
J icomment Well,\sconditionally\strue...\s\r\nEven\smain\sof\smany\sscript\slangs\sare\simplemented\snot\svery\scompliant\sto\s"default"\sparameters\sparsing\s-\ssee\s[the\stable\sin\sspoiler](https://github.com/reactos/reactos/pull/5186#issuecomment-1481559820).\r\n\r\nBut\sthere\sis\s`CommandLineToArgvW`\sas\swell\sas\s`main`\sof\smsvcrt,\sucrt,\slibstdc\s(mingw/gcc)\sand\sco,\sthat\sbehave\sin\sthe\ssame\sway.\r\nEven\sreactos,\swine\sand\sother\s"windows-like"\ssystems\sand\slibraries\simplementing\sthe\scommand\sline\sparsing\sin\sthat\s"standard"\sway.\r\n\r\nAlthough\sthe\smore\sor\sless\scorrect\shandling\sof\scomspec\s(cmd/bat/etc)\sis\shard\sjob,\sand\sone\scan't\sreally\sdo\sthat\sfully\scorrectly\s-\stherefore\sthere\sis\sa\snew\sbranch\s[fix-fb2fa9b3f6--percent-subst-regr](/tcl/vdiff?from=7ed548b6b59bb496&to=fix-fb2fa9b3f6--percent-subst-regr),\sreverting\sparts\sof\sthis\sfix,\shandling\sthe\spercent\schar\sand\sso\srestore\sthe\sbackwards\scompatibility\scalling\scomspec\swith\s`%var%`.\r\nAs\salready\ssaid\smany\stimes\sthe\spercent\sescape\swas\simplemented\sonly\sbecause\sotherwise\sit'd\sremain\sa\sbit\svulnerable\s(double\sand\striple\squotes\smay\schange\sduring\sexec),\sbut\ssince\scomspec\sremains\sunsafe\sby\sdesign,\sone\scould\sindeed\srestore\sthat\shandling\sback\s(using\saforementioned\sbranch).\r\n\r\nMore\sor\sless\swith\sa\sfuture\s`-raw`\soption,\sone'd\sbe\sable\sto\simplement\sown\sescape\sroutines\sfor\sany\skind\sof\sexecutable,\sno\smatter\show\sit\sdoes\sthe\scommand\sline\sparsing.\r\n\r\nThis\sfix\simplements\scorrect\sescape\sfor\s`CommandLineToArgvW`\sas\swell\sas\s`main`\sof\smsvcrt,\sucrt,\slibstdc\s(mingw/gcc)\sand\sco,\sso\squasi\s"standard"\scommand\sline\sparser.\sAnd\swithout\smerge\sof\s`fix-fb2fa9b3f6--percent-subst-regr`\sbranch\salso\sfor\scomspec\sas\sgood\sas\spossible\s(but\sas\salready\ssaid,\sI'm\sfor\smerge\sand\sfix\sit\slater\susing\s`-shell`\soption\sor\sin\ssome\sspecial\shandler\sif\s`-raw`\soption\sgets\simplemented).
J login sebres
J mimetype text/x-markdown
K 21b0629c81fbe38ad153cd8fd899626200a66e15
U sebres
Z d1908e2f2f1ddf871bc436285f8a3a27