Bug 742644 (CVE-2011-3870) - CVE-2011-3870 puppet: SSH authorized_keys symlink attack
Summary: CVE-2011-3870 puppet: SSH authorized_keys symlink attack
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2011-3870
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 742654 742655
Blocks: 742180 748458
TreeView+ depends on / blocked
 
Reported: 2011-09-30 21:27 UTC by Vincent Danen
Modified: 2019-09-29 12:47 UTC (History)
8 users (show)

Fixed In Version: puppet 2.6.11, puppet 2.7.5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-04 06:46:22 UTC


Attachments (Terms of Use)
patch from upstream for 2.6.x and 2.7.x (4.21 KB, patch)
2011-09-30 23:11 UTC, Vincent Danen
no flags Details | Diff
patch from upstream for 0.25.x (2.01 KB, patch)
2011-09-30 23:12 UTC, Vincent Danen
no flags Details | Diff
patch from Jamie Strandboge needed prior to applying upstream's 0.25.x patch (5.09 KB, patch)
2011-09-30 23:14 UTC, Vincent Danen
no flags Details | Diff

Description Vincent Danen 2011-09-30 21:27:57 UTC
A race condition was found in the way puppet handled ssh_authorized_keys.  If a user's authorized_keys file was managed, they could use this flaw to overwrite arbitrary files as root when the target directory and file did not exist.  Puppet would create the directory, ensure that is was user-writable, then wrote the file as the user before changing the file ownership.  In the time between the write and chown/chmod operation, a user could replace the file with a symbolic link and have the operation apply to any file on the disk, as root.

This is corrected in upstream 2.6.11 and 2.7.5 releases.


Acknowledgements:

Red Hat would like to thank the Puppet team for reporting this issue.  Upstream acknowledges Ricky Zhou as the original reporter.

Comment 1 Vincent Danen 2011-09-30 23:11:48 UTC
Created attachment 525844 [details]
patch from upstream for 2.6.x and 2.7.x

Comment 2 Vincent Danen 2011-09-30 23:12:27 UTC
Created attachment 525845 [details]
patch from upstream for 0.25.x

Comment 3 Vincent Danen 2011-09-30 23:14:20 UTC
Created attachment 525846 [details]
patch from Jamie Strandboge needed prior to applying upstream's 0.25.x patch

Jamie noted that this patch needs to be applied prior to what upstream supplied, which are from commits:

ce233aa2a511bf6818f28c226144ec5b05a468ee
8d9575775737c08c6cbfdf7f9a22f2ea4ab21b20
0aae5a71a8e3b38cd8d7041f5c40091887c924a8

Comment 4 Vincent Danen 2011-09-30 23:35:55 UTC
Created puppet tracking bugs for this issue

Affects: fedora-all [bug 742654]
Affects: epel-all [bug 742655]

Comment 5 Fedora Update System 2011-10-24 15:39:31 UTC
puppet-0.25.5-2.el4 has been pushed to the Fedora EPEL 4 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Kurt Seifried 2012-04-11 16:17:07 UTC
Resolved in Puppet 2.7.5 and 2.6.11, CloudForms ships Puppet 2.6.14.

Comment 7 Tomas Hoger 2012-07-04 06:46:22 UTC
Fixed upstream in 2.7.5 and 2.6.11.

External Reference:

http://puppetlabs.com/security/cve/cve-2011-3870/


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