Bug 1101863 (CVE-2014-0240) - CVE-2014-0240 mod_wsgi: possible privilege escalation in setuid() failure scenarios
Summary: CVE-2014-0240 mod_wsgi: possible privilege escalation in setuid() failure sce...
Status: CLOSED ERRATA
Alias: CVE-2014-0240
Product: Security Response
Classification: Other
Component: vulnerability   
(Show other bugs)
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=important,public=20140521,repo...
Keywords: Security
Depends On: 1101869 1101870 1101871 1104687 1104688 1104698 1104699 1104700 1104701 1131467 1131471 1160124
Blocks: 1101877
TreeView+ depends on / blocked
 
Reported: 2014-05-28 05:44 UTC by Murray McAllister
Modified: 2015-11-25 10:10 UTC (History)
35 users (show)

Fixed In Version: mod_wsgi 3.5
Doc Type: Bug Fix
Doc Text:
It was found that mod_wsgi did not properly drop privileges if the call to setuid() failed. If mod_wsgi was set up to allow unprivileged users to run WSGI applications, a local user able to run a WSGI application could possibly use this flaw to escalate their privileges on the system. Note: mod_wsgi is not intended to provide privilege separation for WSGI applications. Systems relying on mod_wsgi to limit or sandbox the privileges of mod_wsgi applications should migrate to a different solution with proper privilege separation.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-21 21:42:49 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0788 normal SHIPPED_LIVE Important: mod_wsgi security update 2014-06-25 19:40:37 UTC
Red Hat Product Errata RHSA-2014:0789 normal SHIPPED_LIVE Important: python27-mod_wsgi and python33-mod_wsgi security update 2014-06-25 19:40:16 UTC
Red Hat Product Errata RHSA-2014:1091 normal SHIPPED_LIVE Important: mod_wsgi security update 2014-08-25 12:59:36 UTC

Description Murray McAllister 2014-05-28 05:44:53 UTC
mod_wsgi allows you to host Python applications on the Apache HTTP Server. It was reported that mod_wsgi could fail to drop root privileges: if the setuid() call failed, an error was logged and mod_wsgi continued running with elevated privileges, rather than exiting.

If an administrator has configured mod_wsgi to allow less trusted users to run a WSGI application, they could use this flaw to escalate their privileges if they are able to cause the setuid() call to fail.

Note that it is not clear whether mod_wsgi was designed to be safe against local attackers, and this may be a similar situation to PHP's safe mode, https://bugzilla.redhat.com/show_bug.cgi?id=169857#c1

This issue has been fixed in mod_wsgi version 3.5.

References:
http://blog.dscpl.com.au/2014/05/security-release-for-modwsgi-version-35.html
https://github.com/GrahamDumpleton/mod_wsgi/commit/d9d5fea585b23991f76532a9b07de7fcd3b649f4

Acknowledgements:

Red Hat would like to thank Graham Dumpleton for reporting of this issue. Upstream acknowledges Róbert Kisteleki as the original reporter.

Comment 1 Murray McAllister 2014-05-28 05:47:49 UTC
Created python26-mod_wsgi tracking bugs for this issue:

Affects: epel-5 [bug 1101871]

Comment 2 Murray McAllister 2014-05-28 05:47:54 UTC
Created mod_wsgi tracking bugs for this issue:

Affects: fedora-all [bug 1101869]
Affects: epel-5 [bug 1101870]

Comment 5 Aaron Knister 2014-06-02 17:51:57 UTC
Are there any plans to fix this for EL6? I didn't see any bugs open for it. Is this perhaps what BZ#1101877 is?

Comment 9 Jason DeTiberus 2014-06-04 14:32:46 UTC
We'll need tracking bugs for OpenShift as well
python27-mod_wsgi for openshift-enterprise-2, openshift-enterprise-2.1, openshift-online
python33-mod_wsgi for openshift-enterprise-2.1, openshift-online

Comment 11 Fedora Update System 2014-06-17 16:57:26 UTC
python26-mod_wsgi-3.5-1.el5, mod_wsgi-3.5-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2014-06-17 23:25:52 UTC
mod_wsgi-3.5-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2014-06-17 23:35:07 UTC
mod_wsgi-3.5-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 errata-xmlrpc 2014-06-25 15:41:33 UTC
This issue has been addressed in following products:

  Red Hat Software Collections 1 for Red Hat Enterprise Linux 6
  Red Hat Software Collections 1 for Red Hat Enterprise Linux 6.3 EUS
  Red Hat Software Collections 1 for Red Hat Enterprise Linux 6.4 EUS
  Red Hat Software Collections 1 for Red Hat Enterprise Linux 7

Via RHSA-2014:0789 https://rhn.redhat.com/errata/RHSA-2014-0789.html

Comment 16 errata-xmlrpc 2014-06-25 15:42:22 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2014:0788 https://rhn.redhat.com/errata/RHSA-2014-0788.html

Comment 19 Kurt Seifried 2014-08-08 19:37:28 UTC
Red Hat Update Infrastructure 2.1.3 is now in Production 2 Phase of the support and maintenance life cycle. This has been rated as having Important security impact, however as used in RHUI this issue is not exposed to untrusted users, as such it is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Update Infrastructure Life Cycle: https://access.redhat.com/support/policy/updates/rhui.

Comment 23 Martin Prpič 2014-08-20 07:59:09 UTC
IssueDescription:

It was found that mod_wsgi did not properly drop privileges if the call to setuid() failed. If mod_wsgi was set up to allow unprivileged users to run WSGI applications, a local user able to run a WSGI application could possibly use this flaw to escalate their privileges on the system.

Note: mod_wsgi is not intended to provide privilege separation for WSGI applications. Systems relying on mod_wsgi to limit or sandbox the privileges of mod_wsgi applications should migrate to a different solution with proper privilege separation.

Comment 24 errata-xmlrpc 2014-08-25 08:59:49 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 7

Via RHSA-2014:1091 https://rhn.redhat.com/errata/RHSA-2014-1091.html


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