Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1631420 - (CVE-2018-1000802) CVE-2018-1000802 python: Command injection in the shutil module
CVE-2018-1000802 python: Command injection in the shutil module
Status: CLOSED NOTABUG
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20180829,repor...
: Security
Depends On: 1631421 1631662
Blocks: 1631422
  Show dependency treegraph
 
Reported: 2018-09-20 10:32 EDT by Andrej Nemec
Modified: 2018-10-24 11:46 EDT (History)
19 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
It was discovered that the shutil module of python does not properly sanitize input when creating a zip file on Windows. An attacker could use this flaw to cause a denial of service or add unintended files to the generated archive.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-10-10 03:33:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrej Nemec 2018-09-20 10:32:08 EDT
A command injection vulnerability was found in the shutil module (make_archive function) of Python that can result in Denial of Service or Information leak.

Upstream issue:

https://bugs.python.org/issue34540

Upstream patch:

https://github.com/python/cpython/pull/8985/commits/add531a1e55b0a739b0f42582f1c9747e5649ace
Comment 1 Andrej Nemec 2018-09-20 10:33:00 EDT
Created python26 tracking bugs for this issue:

Affects: fedora-all [bug 1631421]
Comment 2 Miro Hrončok 2018-09-20 14:59:32 EDT
While python26 is not impacted, python2 actually is.

Here's a PR: https://src.fedoraproject.org/rpms/python2/pull-request/26
Comment 3 Andrej Nemec 2018-09-21 04:43:39 EDT
Created python2 tracking bugs for this issue:

Affects: fedora-all [bug 1631662]
Comment 4 Riccardo Schirone 2018-10-05 03:47:54 EDT
Hi Miro,

Why are you saying that python2 is affected on Fedora?
I'm asking because I wasn't able to reproduce this flaw on Linux and I believe it can be triggered on Windows only. Do you have more information on this?
Comment 5 Miro Hrončok 2018-10-09 09:00:57 EDT
Oh. I only meant that the code is in 2.7, I haven't checked that the flaw is actually usable or Python 2.7 on Linux vulnerable.
Comment 6 Riccardo Schirone 2018-10-10 03:33:46 EDT
This doesn't seem to be exploitable when os.name != 'nt' (Windows). The main problem is that quoting is done in distutils.py/spawn.py:_nt_quote_args and it just wraps arguments in `"`, without escaping previous existing `"`. Moreover, os.spawn in Windows uses CreateProcess underneath, which transforms the list of arguments in a single string, thus creating this flaw there. On linux, execv family functions are used and each argument is interpreted as a single filename, preventing this flaw.
Comment 8 Riccardo Schirone 2018-10-10 03:42:22 EDT
Statement:

This issue did not affect the versions of python as shipped with Red Hat Enterprise Linux 5, 6 and 7 as Linux does not use the vulnerable code.

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