Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6be49fd2514b83a7397a78d7b19036e06a7eb9cc05dede05cdc1d03fa9d21074
Ticket: fb2fa9b3f6467ee66f543ec904e37aa8508f2fb1
exec broken for command having windows environment variables
User & Date: sebres on 2023-10-27 08:33:41
Changes

  1. icomment:
    Well, the reason why I called it vulnerability is that as already said in [344b1a0c0] as well as by fixing in [21b0629c81] - windows doesn't really have correct way to escape quotes by calling of command processor, and because substitution of <code>%var%</code> may insert quotes too, although they are mostly paired, the previously escaped string may become extra double/triple quotes, which could topple the whole escape, sometimes to completely unescaped parameters (and so can open a vector for an inject, because can invoke commands after pipe or ampersand chars in some parameter).
    
    Sure it is a clear regression in sense of backwards compatibility, just since there is no way to fix it properly without to introduce some new options for <code>exec</code>, like <code>-shellescape</code> or <code>-unescape</code> (expected TIP) etc, it was fixed in this way.
    
    Feel free to revert it in part affecting <code>%</code>-escape, just as already said it would be a half solution then.
    
    However I don't realy understand why someone'd need to subst <code>%var%</code> in the command processor, where it is pretty simple with <code>$::env(var)</code> by invokation of <code>exec</code>.
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"