Overview
| Artifact ID: | 8d99d3fd46af06079dc5b0bcf44b791efd1fc9c77c84e50afa85927b476fd4a4 |
|---|---|
| Ticket: | 21b0629c81fbe38ad153cd8fd899626200a66e15
0-day vulnerability - insufficient escape by exec of batch-files for windows |
| User & Date: | dkf on 2023-11-14 16:04:35 |
Changes
- icomment:
Ultimately, there isn't that much we can do because *Windows itself is not consistent.* When dealing with the Windows command line, parsing of that command line is done by the receiving program (usually by it's runtime bootstrap code) and that's inconsistent because there are multiple different runtimes in use out there. It's especially bad when dealing with the `CMD` builtins like `START`, but that's simply the most easily noticed. (There were, according to David Gravereaux, who worked on this, outright incompatibilities between the MSVC runtime and the Borland runtime that just could never be resolved; each had situations where it demanded quoting and the other required no quoting.) Tcl has historically taken the view of trying to make things work well with the MSVC runtime (by far the most common) and for the rest... well, you can write stuff into a batch script (with as much safe control as you like) and run that. It's an impossible situation; direct use of the Windows command line to run programs with untrusted arguments is simply not secure. Note that `exec` and `open` are _never_ exposed directly in a safe interpreter; there's a reason for this and it's not something we're likely to change soon. All IIRC. I've not made much use of this knowledge for over a decade (other than to always give `START` a leading blank argument because it's particularly awful).
- login: "dkf"
- mimetype: "text/x-markdown"