Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 807316771add2eb5c16417e2d86175948c0cd69f6aa9625965739e7d4a371ab1
Ticket: fb2fa9b3f6467ee66f543ec904e37aa8508f2fb1
exec broken for command having windows environment variables
User & Date: apnadkarni on 2023-10-25 10:37:47
Changes

  1. icomment:
    Thanks Harald, you're a real historian for Tcl :-)
    
    Rightly or wrongly, Tcl seems to be the only language (it's been proposed for other languages as well) that has incorporated this "fix". I'm skeptical of the utility of this given that for programs exec'ing cmd.exe, this would be like plugging a single hole in a rather large sieve. If the attacker has control of the arguments as seemingly required here, what is to stop him from simply having the arguments be "format C:" for example? Or given that cmd.exe is a (very poor) language, to construct a command (using pipes, `for` and friends) or recurse in any number of ways?
    
    So even though the issue might be real, I would not have been in favour of a change that is incompatible, afaict precludes legitimate uses, and only addresses a single point in the attack surface.
    
    It's water under the bridge but for future reference for anyone having the inclination to pursue this, informative links on intricacy of Windows command parsing:
    
    https://daviddeley.com/autohotkey/parameters/parameters.htm#WIN
    
    https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
    
  2. login: "apnadkarni"
  3. mimetype: "text/x-markdown"