Bug 680798 (CVE-2011-1098)
Summary: | CVE-2011-1098 logrotate: TOCTOU race condition by creation of new files (between opening the file and moment, final permissions have been applied) [information disclosure] | ||||||
---|---|---|---|---|---|---|---|
Product: | [Other] Security Response | Reporter: | Jan Lieskovsky <jlieskov> | ||||
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> | ||||
Status: | CLOSED ERRATA | QA Contact: | |||||
Severity: | low | Docs Contact: | |||||
Priority: | low | ||||||
Version: | unspecified | CC: | bressers, jkaluza, jrusnack, mjc, petr.uzel | ||||
Target Milestone: | --- | Keywords: | Security | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-07-30 13:14:03 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | 688518, 688519, 688520 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Jan Lieskovsky
2011-02-27 19:41:45 UTC
Further flaw details from Stefan Fritsch of Debian Security Team: ================================================================== The race is between 192 fd = open(fileName, flags, sb->st_mode); and 198 if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) { and later 204 if (fchown(fd, sb->st_uid, sb->st_gid)) { An attacker may be able to open the newly created file after line 192, even if he has no permissions to open the file after lines 198 and 204 have been executed. Once he has the open file descriptor, he can read what will be written into the file. No symlink attack is needed. This has been assigned CVE-2011-1098 Created attachment 485707 [details] proposed patch This patch fixes the issue by creating temp file with umask 0000, then change owner/mode and renames it to log file. Upstream fixed it by use of "su" directive patch described in Bug 680799 Comment 2, but this patch breaks backward compatibility for some configurations. Attached patch is possible workaround which keeps backward compatibility. Created logrotate tracking bugs for this issue Affects: fedora-all [bug 688520] This issue has been addressed in following products: Red Hat Enterprise Linux 6 Via RHSA-2011:0407 https://rhn.redhat.com/errata/RHSA-2011-0407.html Statement: The Red Hat Security Response Team has rated this issue as having low security impact, a future update may address this flaw. |