Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7ebe656be15ad6f51a69eb57725eec5eaba334ad3b51215305c7a3a0d8244b8c
Ticket: 21b0629c81fbe38ad153cd8fd899626200a66e15
0-day vulnerability - insufficient escape by exec of batch-files for windows
User & Date: sebres on 2018-08-20 18:08:01
Changes

  1. icomment:
    Although this fixed the issue, at the same time it is a bit incompatible if wanted "raw" (not escaped) arguments,<br/> for example by invocation of <code>cmd /c ...something raw, because script...</code>
    
    Search for exec in own (as well as many open source) projects, shows me almost never the usage of "raw" arguments as expected case. In contrary, many invocation's of <code>cmd /c</code> expecting also that arguments are escaped properly.<br/>
    Let alone real raw data were anyway impossible (because previously partially escaped also).
    
    Therefore (and because this fixed a grave 0-day vulnerability), the default escape should take place as it is implemented in 0-day-21b0629c81.
    
    But perhaps, just to provide the developer a possibility to invoke <code>cmd /c</code> with raw-unescaped scripts (e. g. something enclosed in 2x double-quoted block, like <code>cmd /c ""...raw-script...""</code> etc.), I suggest to extend "exec" with new option "-raw".
    <code><pre style="padding-left: 10pt">
    exec -raw cmd /c ""...raw-script-dev-want-escape-independent...""
    </pre></code>
    For *unix-platforms this can be simply ignored, but I assume it will be anyway used with <code>exec cmd</code> only, so already encapsulated into <code>if {$::tcl_platform(platform) eq "windows"} {exec -raw cmd ...}</code>.
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"