Bug 1205752 (CVE-2015-2704)

Summary: CVE-2015-2704 realmd: untrusted data is used when configuring sssd.conf and/or smb.conf
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: carnil, ebenes, jhrozek, jrusnack, pkis, stefw
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A flaw was found in the way realmd parsed certain input when writing configuration into the sssd.conf or smb.conf file. A remote attacker could use this flaw to inject arbitrary configurations into these files via a newline character in an LDAP response.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-20 05:59:17 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: 1205754, 1233011    
Bug Blocks: 1205773, 1210268    
Attachments:
Description Flags
Validate text from LDAP none

Description Vasyl Kaigorodov 2015-03-25 15:01:48 UTC
It was reported to upstream that realmd is using untrusted data when configuring sssd.conf and/or smb.conf:

https://bugs.freedesktop.org/show_bug.cgi?id=89207

No patches are available at the time of writing.

Comment 1 Stef Walter 2015-04-14 09:45:38 UTC
Commits available upstream.

Comment 2 Stef Walter 2015-04-14 10:31:20 UTC
Relevant commits:

commit 6d5ac47cc22c273a55bea89dffbe537a3c86ad2c
Author: Stef Walter <stefw>
Date:   Tue Apr 14 11:30:53 2015 +0200

    service: Limit the characters we read from LDAP
    
    We strictly limit this to characters expected in domain names.


commit 502980a8a17eddb5fe3d16bcad229a6d0ba11065
Author: Stef Walter <stefw>
Date:   Sat Apr 11 13:29:40 2015 +0200

    service: Only accept specific characters when parsing MSCLDAP response
    
    This provides an extra layer of protection against injecting
    odd characters into configuration files.

Comment 3 Stef Walter 2015-04-14 11:06:17 UTC
Created attachment 1014276 [details]
Validate text from LDAP

Combined patch for this issue.

Comment 5 Fedora Update System 2015-04-22 22:55:31 UTC
realmd-0.16.0-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2015-05-08 07:41:54 UTC
realmd-0.15.2-2.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 errata-xmlrpc 2015-11-19 03:43:51 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2015:2184 https://rhn.redhat.com/errata/RHSA-2015-2184.html