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:
Depends On: 1541559
Blocks: 1541563
TreeView+ depends on / blocked
 
Reported: 2018-02-02 21:46 UTC by Laura Pardo
Modified: 2021-02-17 00:52 UTC (History)
4 users (show)

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


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 3 Doran Moppert 2020-01-21 23:22:29 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.

This CVE assignment was disputed by upstream. While an attack is theoretically possible, it relies on a programming pattern in the vulnerable Python program that is generally considered bad practice if not an outright bug.


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