Bug 1631420 (CVE-2018-1000802)
| Summary: | CVE-2018-1000802 python: Command injection in the shutil module | ||
|---|---|---|---|
| Product: | [Other] Security Response | Reporter: | Andrej Nemec <anemec> |
| Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | unspecified | CC: | adev88, bkabrda, cstratak, dmalcolm, hhorak, jeffrey.ness, jorton, kevin, mcyprian, mhroncok, pviktori, python-maint, rkuska, security-response-team, shcherbina.iryna, slawomir, TicoTimo, tomspur, torsava |
| Target Milestone: | --- | Keywords: | Security |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| 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 07:33:46 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: | 1631421, 1631662 | ||
| Bug Blocks: | 1631422 | ||
|
Description
Andrej Nemec
2018-09-20 14:32:08 UTC
Created python26 tracking bugs for this issue: Affects: fedora-all [bug 1631421] While python26 is not impacted, python2 actually is. Here's a PR: https://src.fedoraproject.org/rpms/python2/pull-request/26 Created python2 tracking bugs for this issue: Affects: fedora-all [bug 1631662] 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? 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. 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. 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. |