Bug 223076 - CVE-2006-6939 Insecure use of temporary file in ed
CVE-2006-6939 Insecure use of temporary file in ed
Status: CLOSED DUPLICATE of bug 21470
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ed (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Karsten Hopp
Ben Levenson
: Security
Depends On: 223072
  Show dependency treegraph
Reported: 2007-01-17 14:43 EST by Lubomir Kundrak
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-23 14:27:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Lubomir Kundrak 2007-01-17 14:43:40 EST
+++ This bug was initially created as a clone of Bug #223072 +++

Description of problem:

Version 0.3 of GNU ed replaced use of unsecure mktemp() followed
by fopen() in buf.c:open_sbuf() with tmpnam(). The former construction
is vulnerable to race condition, where a malicous user can create
the temporary file between two function calls, as they are non-atomic,
and then either read or write the contents of the file, or make it
a symbolic link to a file owned by the victim resulting in its overite.

Version-Release number of selected component (if applicable):

GNU ed 0.2, in RHEL{2.1,3,4,5} and FC{5,6}

How reproducible:

Time-dependent race condition, very unlikely.

Steps to Reproduce:
1. Attempt to guess the filename returned by mktemp() and attempt
create it while being schelduled between mktemp() and fopen() calls.

-- Additional comment from lkundrak@redhat.com on 2007-01-17 14:34 EST --
Created an attachment (id=145853)
Backported patch that corrects CVE-2006-6939 GNU ed insecure tmp file handling.

-- Additional comment from lkundrak@redhat.com on 2007-01-17 14:38 EST --
Radek Vokal told me that then only good patch is one that has more '-'-es
than '+'-es. He'd be glad if he saw my patch :)
Comment 1 Josh Bressers 2007-01-23 14:27:06 EST
This flaw is really CVE-2000-1137, which we fixed in 2000 via bug 21470.  I'm
marking this bug a dupe.

The patch ed-mkstemp.patch fixes this flaw.

*** This bug has been marked as a duplicate of 21470 ***
Comment 2 Mark J. Cox 2007-01-24 04:03:36 EST
dropping flags, is notabug

Note You need to log in before you can comment on or make changes to this bug.