Bug 1292432 (CVE-2015-1336)

Summary: CVE-2015-1336 man-db: TOCTOU bug when processing catman pages
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: anemec, cjwatson, jchaloup, nforro
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: 2016-06-07 06:22:58 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: 1292433    
Bug Blocks: 1292434    

Description Martin Prpič 2015-12-17 12:49:01 UTC
The following flaw was found in man-db:

The daily mandb cleanup job for old catman pages changes the permissions of all non-man files to user man.

Originally filed against Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/man-db/+bug/1482786

External References:

http://www.halfdog.net/Security/2015/MandbSymlinkLocalRootPrivilegeEscalation/

Comment 1 Martin Prpič 2015-12-17 12:49:30 UTC
Created man-db tracking bugs for this issue:

Affects: fedora-all [bug 1292433]

Comment 2 Nikola Forró 2016-01-04 13:26:06 UTC
Hello,

It appears to me that Fedora and RHEL7 man-db packages are not affected by this, since there is no cleanup job for old catman pages there:
http://pkgs.fedoraproject.org/cgit/man-db.git/tree/man-db.crondaily?h=f23

Comment 3 Doran Moppert 2016-06-07 06:15:54 UTC
Nikola's comment above is correct:  man-db in rhel and fedora are not
affected.  The man-db crontab in both doesn't chown thus lacks the
TOCTOU issue, plus (at least on rhel) /var/cache/man lacks the setgid
bit which makes the other part of this attack possible.