<i>0-day vulnerability - insufficient escape by exec of batch-files for windows</i> status still Open with 3 other changes
by
.
D 2023-11-14T16:04:35.544
J icomment Ultimately,\sthere\sisn't\sthat\smuch\swe\scan\sdo\sbecause\s*Windows\sitself\sis\snot\sconsistent.*\sWhen\sdealing\swith\sthe\sWindows\scommand\sline,\sparsing\sof\sthat\scommand\sline\sis\sdone\sby\sthe\sreceiving\sprogram\s(usually\sby\sit's\sruntime\sbootstrap\scode)\sand\sthat's\sinconsistent\sbecause\sthere\sare\smultiple\sdifferent\sruntimes\sin\suse\sout\sthere.\sIt's\sespecially\sbad\swhen\sdealing\swith\sthe\s`CMD`\sbuiltins\slike\s`START`,\sbut\sthat's\ssimply\sthe\smost\seasily\snoticed.\s(There\swere,\saccording\sto\sDavid\sGravereaux,\swho\sworked\son\sthis,\soutright\sincompatibilities\sbetween\sthe\sMSVC\sruntime\sand\sthe\sBorland\sruntime\sthat\sjust\scould\snever\sbe\sresolved;\seach\shad\ssituations\swhere\sit\sdemanded\squoting\sand\sthe\sother\srequired\sno\squoting.)\r\n\r\nTcl\shas\shistorically\staken\sthe\sview\sof\strying\sto\smake\sthings\swork\swell\swith\sthe\sMSVC\sruntime\s(by\sfar\sthe\smost\scommon)\sand\sfor\sthe\srest...\swell,\syou\scan\swrite\sstuff\sinto\sa\sbatch\sscript\s(with\sas\smuch\ssafe\scontrol\sas\syou\slike)\sand\srun\sthat.\sIt's\san\simpossible\ssituation;\sdirect\suse\sof\sthe\sWindows\scommand\sline\sto\srun\sprograms\swith\suntrusted\sarguments\sis\ssimply\snot\ssecure.\sNote\sthat\s`exec`\sand\s`open`\sare\s_never_\sexposed\sdirectly\sin\sa\ssafe\sinterpreter;\sthere's\sa\sreason\sfor\sthis\sand\sit's\snot\ssomething\swe're\slikely\sto\schange\ssoon.\r\n\r\nAll\sIIRC.\sI've\snot\smade\smuch\suse\sof\sthis\sknowledge\sfor\sover\sa\sdecade\s(other\sthan\sto\salways\sgive\s`START`\sa\sleading\sblank\sargument\sbecause\sit's\sparticularly\sawful).
J login dkf
J mimetype text/x-markdown
K 21b0629c81fbe38ad153cd8fd899626200a66e15
U dkf
Z 9d23dc7f7e5b77c8a9aea0175b18673f