Vulnerability Note VU#10277
Various shells create temporary files insecurely when using << operator
Overview
sh uses /tmp files of a predictable name in creating files for input redirection using the << operator.
Description
When performing the "<<" redirection, /bin/sh creates a temporary file in /tmp with a name based on the process id, writes subsequent input out to that file, and then closes the file before re-opening it as the standard input of the command to be executed. At no stage are the results of the creat(), write(), or open() calls checked for an error status. |
Impact
It is possible for another user to alter what is read from this file.
It may also be possible to create a symbolic link named as the temporary file and pointed to any other file on the system writable by the user of the shell, which may lead to corruption of the file to which the link is pointed. |
Solution
Apply vendor patches; see the Systems Affected section below. |
Avoid the use of << operator in cron jobs and similar administration scripts. |
Systems Affected
| Vendor | Status | Date Notified | Date Updated |
|---|---|---|---|
| Apple Computer, Inc. | Vulnerable | 14 May 2001 | 24 Apr 2007 |
| Berkeley Software Design, Inc. | Not Vulnerable | 14 May 2001 | 24 Apr 2007 |
| Compaq Computer Corporation | Vulnerable | 14 May 2001 | 24 Apr 2007 |
| Data General | Unknown | 14 May 2001 | 24 Apr 2007 |
| Debian Linux | Unknown | 14 May 2001 | 24 Apr 2007 |
| DEC | Vulnerable | 14 May 2001 | 24 Apr 2007 |
| FreeBSD, Inc. | Vulnerable | 20 Nov 2000 | 24 Apr 2007 |
| Fujitsu | Unknown | 14 May 2001 | 24 Apr 2007 |
| Hewlett-Packard Company | Vulnerable | 14 May 2001 | 24 Apr 2007 |
| IBM Corporation | Vulnerable | 14 May 2001 | 24 Apr 2007 |
| Mandriva, Inc. | Vulnerable | 20 Nov 2000 | 24 Apr 2007 |
| NEC Corporation | Unknown | 14 May 2001 | 24 Apr 2007 |
| NetBSD | Unknown | 14 May 2001 | 24 Apr 2007 |
| NeXT | Unknown | 14 May 2001 | 24 Apr 2007 |
| OpenBSD | Not Vulnerable | 30 Oct 2000 | 24 Apr 2007 |
CVSS Metrics (Learn More)
| Group | Score | Vector |
|---|---|---|
| Base | N/A | N/A |
| Temporal | N/A | N/A |
| Environmental | N/A | N/A |
References
- http://www.securityfocus.com/bid/3996
- http://www.securityfocus.com/bid/2006
- ftp://patches.sgi.com/support/free/security/advisories/20011103-01-I
Credit
The original discoverer of this vul was Gordon Irlam of the Univeristy of Adelaide, Australia.
This document was written by James T. Ellis, modified by Tim Shimeall to reflect 2001 reporting
Other Information
- CVE IDs: CVE-2000-1134
- Date Public: 17 Jul 91
- Date First Published: 02 Jul 2001
- Date Last Updated: 24 Apr 2007
- Severity Metric: 1.73
- Document Revision: 19
Feedback
If you have feedback, comments, or additional information about this vulnerability, please send us email.
This product is provided subject to the Notification as indicated here: http://www.us-cert.gov/legal.html#notify