Bug 680787 - logrotate: TOCTOU race condition by creating the compressed or copied log file (information disclosure)
logrotate: TOCTOU race condition by creating the compressed or copied log fil...
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On:
  Show dependency treegraph
Reported: 2011-02-27 14:12 EST by Jan Lieskovsky
Modified: 2016-03-04 06:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-03-11 01:29:21 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 Jan Lieskovsky 2011-02-27 14:12:48 EST
A file access race condition (time-of-check, time-of-use, TOCTOU
race condition) was found in the way logrotate determines the
permissions to newly created files when compression or copying of a
log file has been requested. If the logrotate utility was run on a log
file contained within an attacker controllable directory, a local
attacker could use this flaw to trick the logrotate utility into
creating the compressed or copied file with user selected permissions,
potentially leading to disclosure of sensitive information.
Comment 4 Jan Lieskovsky 2011-03-03 04:20:50 EST
Further clarified flaw information from Stefan Fritsch of Debian Security Team:

Both compressLogFile() and copyTruncate() are vulnerable to this
issue. Instead of using the permissions passed in sb, both functions
should call fstat() on the opened file.

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