Bug 1034261 (CVE-2013-6412) - CVE-2013-6412 augeas: incorrect permissions set on newly created files
Summary: CVE-2013-6412 augeas: incorrect permissions set on newly created files
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2013-6412
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1036079 1036080 1036081 1036082 1036083 1054129 1058938
Blocks: 1034264
TreeView+ depends on / blocked
 
Reported: 2013-11-25 14:05 UTC by Tomas Hoger
Modified: 2021-10-20 10:41 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-20 10:41:56 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0044 0 normal SHIPPED_LIVE Moderate: augeas security update 2014-01-20 22:30:48 UTC

Description Tomas Hoger 2013-11-25 14:05:59 UTC
Augeas upstream commit 051c73a9:

https://github.com/hercules-team/augeas/commit/051c73a9

introduced a flaw in the way Augeas sets permissions on newly created files.  The above commit aims to address a regression introduced in the fix for CVE-2012-0786 (see bug 772257 comment 39), which introduced a use of mkstemp() to create new files.  mkstemp() always sets 0600 file permissions regardless of the current umask setting.  Commit 051c73a9 attempts to fix file permissions based on umask setting, but it does not correctly handle certain umask values, causing Augeas to make newly created files world writable.  A local user could possibly use this flaw to modify configuration files created by an application using Augeas.

Comment 1 lutter@watzmann.net 2013-11-25 15:44:12 UTC
I would fix this by changing the second arg to fchmod on line 1105 to '0666 - curumsk & 0666' - do you think that is sufficient as a fix here ?

Comment 2 Dominic Cleal 2013-11-25 15:45:26 UTC
(In reply to lutter@watzmann.net from comment #1)
> I would fix this by changing the second arg to fchmod on line 1105 to '0666
> - curumsk & 0666' - do you think that is sufficient as a fix here ?

Or 0666 & ~curumask I think.

Comment 4 Tomas Hoger 2013-11-28 15:12:01 UTC
This issue only affects augeas packages in Red Hat Enterprise Linux 6 as of RHSA-2013:1537 (augeas-1.0.0-5.el6), released as part of Red Hat Enterprise Linux 6.5, which is the update that corrected CVE-2012-0786 and introduced this problem - see bug 772257 comment 51.  augeas packages in older Red Hat Enterprise Linux 6 versions are not affected.

Comment 5 Tomas Hoger 2013-11-29 11:36:14 UTC
Assigning CVE-2013-6412.

Comment 7 Tomas Hoger 2013-11-29 11:39:38 UTC
Created augeas tracking bugs for this issue:

Affects: fedora-all [bug 1036082]
Affects: epel-5 [bug 1036083]

Comment 8 Dominic Cleal 2013-12-02 18:10:53 UTC
Patch submitted, pending review:
https://github.com/hercules-team/augeas/pull/58

Comment 9 Dominic Cleal 2014-01-14 09:36:23 UTC
Merged upstream:
https://github.com/hercules-team/augeas/commit/f5b4fc0c

Comment 10 Martin Prpič 2014-01-14 10:05:33 UTC
Acknowledgment:

This issue was discovered by the Red Hat Security Response Team.

Comment 12 errata-xmlrpc 2014-01-20 17:32:28 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2014:0044 https://rhn.redhat.com/errata/RHSA-2014-0044.html

Comment 13 Fedora Update System 2014-03-15 15:06:02 UTC
augeas-1.2.0-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2014-03-15 15:11:09 UTC
augeas-1.2.0-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2014-08-08 00:41:07 UTC
augeas-1.2.0-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.


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