Bug 1541558 (CVE-2018-1000030) - CVE-2018-1000030 python: Heap-Buffer-Overflow and Heap-Use-After-Free in Objects/fileobject.c
Summary: CVE-2018-1000030 python: Heap-Buffer-Overflow and Heap-Use-After-Free in Obje...
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2018-1000030
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=low,public=20170920,reported=2...
Depends On: 1541559
Blocks: 1541563
TreeView+ depends on / blocked
 
Reported: 2018-02-02 21:46 UTC by Laura Pardo
Modified: 2019-06-08 22:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-06 02:05:11 UTC


Attachments (Terms of Use)

Description Laura Pardo 2018-02-02 21:46:41 UTC
Python 2.7.x is vulnerable to a Heap-Buffer-Overflow as well as a Heap-Use-After-Free. The vulnerability lies when multiply threads are handling large amounts of data. In both cases there is essentially a race condition that occurs. For the Heap-Buffer-Overflow, Thread 2 is creating the size for a buffer, but Thread1 is already writing to the buffer without knowing how much to write. So when a large amount of data is being processed, it is very easy to cause memory corruption using a Heap-Buffer-Overflow. As for the Use-After-Free, Thread3->Malloc->Thread1->Free's->Thread2-Re-uses-Free'd Memory.

References:
https://bugs.python.org/issue31530
https://github.com/CVEProject/cvelist/pull/292/files/5dae4ae63f0c19fb7e30b0f9ee1cf21e232209b1#diff-97ec95c41730bace57df441d3f00c9a3
https://drive.google.com/file/d/1oyR9DAZjZK_SCn3mor6NRAYLJS6ueXaY/view
https://www.dropbox.com/sh/sj3ee7xv55j36k7/AADwP-YfOYikBMuy32e0uvPFa?dl=0

Patch:
https://bugs.python.org/file47157/0001-stop-crashes-when-iterating-over-a-file-on-multiple-.patch

Comment 1 Laura Pardo 2018-02-02 21:47:04 UTC
Created python tracking bugs for this issue:

Affects: fedora-all [bug 1541559]

Comment 2 Doran Moppert 2018-02-06 02:05:20 UTC
Statement:

Versions of Python 2 included in Red Hat Enterprise Linux 6 and 7 are affected by this issue. Reading concurrently from the same file handle in multiple threads is inherently unstable, and should not be relied upon in any real program. This issue is not planned to be fixed in future releases.


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