Bug 848022 (CVE-2012-3500)

Summary: CVE-2012-3500 rpmdevtools: TOCTOU race condition in annotate-output
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: meyering, security-response-team, twoerner, ville.skytta
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=low,public=20120831,reported=20120813,source=redhat,cvss2=1.9/AV:L/AC:M/Au:N/C:N/I:P/A:N,rhel-6/rpmdevtools=affected,fedora-all/rpmdevtools=affected,epel-5/rpmdevtools=notaffected,cwe=CWE-367[auto]
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-15 10:42:42 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 847768, 853452    
Bug Blocks: 848864    
Attachments:
Description Flags
Proposed patch by Jim Meyering to fix CVE-2012-3500 none

Description Jan Lieskovsky 2012-08-14 06:47:55 EDT
A TOCTOU race condition was found in the way 'annotate-output' (used to execute a program annotating the output linewise with time and stream) tool of rpmdevtools, a suite of scripts and (X)Emacs support files to aid in development of RPM packages, performed management of its temporary files used for standard output and standard error output. A local attacker could use this flaw to conduct symbolic link attacks, possibly leading to their ability in an unauthorized way to alter files belonging to the user running the 'annotate-output' tool.


Issue found by Jim Meyering of Red Hat.
Comment 1 Jan Lieskovsky 2012-08-14 06:50:32 EDT
This issue affects the version of the rpmdevtools package, as shipped with
Red Hat Enterprise Linux 6.

--

This issue affects the versions of the rpmdevtools package, as shipped with Fedora release of 16 and 17.

--

This issue did NOT affect the version of the rpmdevtools package, as shipped with Fedora EPEL 5 as it did not include support for 'annotate-output' tool yet.
Comment 2 Jan Lieskovsky 2012-08-14 06:52:19 EDT
Created attachment 604260 [details]
Proposed patch by Jim Meyering to fix CVE-2012-3500
Comment 3 Jan Lieskovsky 2012-08-16 11:12:24 EDT
The CVE identifier of CVE-2012-3500 has been assigned to this issue.
Comment 7 Jan Lieskovsky 2012-08-31 11:11:46 EDT
Created rpmdevtools tracking bugs for this issue

Affects: fedora-all [bug 853452]
Comment 8 Tomas Hoger 2012-09-20 09:27:27 EDT
(In reply to comment #0)

> A local attacker could use this flaw to conduct symbolic link attacks, possibly
> leading to their ability in an unauthorized way to alter files belonging to the
> user running the 'annotate-output' tool.

Following post clarifies that as the mkfifo is used to create temporary "files", this does not allow symlink attack and can at worst cause the script to exit early with an error.

http://thread.gmane.org/gmane.comp.security.oss.general/8277/focus=8286
Comment 9 Tomas Hoger 2012-11-15 10:42:42 EST
Closing as not-a-security-bug based on the information in comment 8.

The fix was applied in Fedora and hence should be included in future Red Hat Enterprise Linux versions.  There's no plan to fix this issue as a security flaw in Red Hat Enterprise Linux 6.