CVE-2021-3177
Published: 19 January 2021
Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code execution in certain Python applications that accept floating-point numbers as untrusted input, as demonstrated by a 1e300 argument to c_double.from_param. This occurs because sprintf is used unsafely.
Notes
Author | Note |
---|---|
mdeslaur |
on Ubuntu, binaries are compiled with Fortify Source, so exploiting this issue will likely only cause Python to crash, leading to a denial of service. |
Priority
Status
Package | Release | Status |
---|---|---|
python2.7
Launchpad, Ubuntu, Debian |
bionic |
Released
(2.7.17-1~18.04ubuntu1.6)
|
focal |
Released
(2.7.18-1~20.04.1)
|
|
groovy |
Ignored
(end of life)
|
|
hirsute |
Not vulnerable
(2.7.18-4)
|
|
impish |
Not vulnerable
(2.7.18-4)
|
|
jammy |
Not vulnerable
(2.7.18-4)
|
|
kinetic |
Not vulnerable
(2.7.18-4)
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Released
(2.7.6-8ubuntu0.6+esm10)
Available with Ubuntu Pro or Ubuntu Pro (Infra-only) |
|
upstream |
Needs triage
|
|
xenial |
Released
(2.7.12-1ubuntu0~16.04.18)
|
|
This vulnerability is mitigated in part by the use of -D_FORTIFY_SOURCE=2 in Ubuntu. | ||
python3.4
Launchpad, Ubuntu, Debian |
bionic |
Does not exist
|
focal |
Does not exist
|
|
groovy |
Does not exist
|
|
hirsute |
Does not exist
|
|
impish |
Does not exist
|
|
jammy |
Does not exist
|
|
kinetic |
Does not exist
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Released
(3.4.3-1ubuntu1~14.04.7+esm10)
Available with Ubuntu Pro or Ubuntu Pro (Infra-only) |
|
upstream |
Needs triage
|
|
xenial |
Does not exist
|
|
This vulnerability is mitigated in part by the use of -D_FORTIFY_SOURCE=2 in Ubuntu. | ||
python3.5
Launchpad, Ubuntu, Debian |
bionic |
Does not exist
|
focal |
Does not exist
|
|
groovy |
Does not exist
|
|
hirsute |
Does not exist
|
|
impish |
Does not exist
|
|
jammy |
Does not exist
|
|
kinetic |
Does not exist
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Released
(3.5.2-2ubuntu0~16.04.4~14.04.1+esm1)
Available with Ubuntu Pro or Ubuntu Pro (Infra-only) |
|
upstream |
Needs triage
|
|
xenial |
Released
(3.5.2-2ubuntu0~16.04.13)
|
|
This vulnerability is mitigated in part by the use of -D_FORTIFY_SOURCE=2 in Ubuntu. | ||
python3.6
Launchpad, Ubuntu, Debian |
bionic |
Released
(3.6.9-1~18.04ubuntu1.4)
|
focal |
Does not exist
|
|
groovy |
Does not exist
|
|
hirsute |
Does not exist
|
|
impish |
Does not exist
|
|
jammy |
Does not exist
|
|
kinetic |
Does not exist
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Does not exist
|
|
upstream |
Needs triage
|
|
xenial |
Does not exist
|
|
Patches:
upstream: https://github.com/python/cpython/commit/34df10a9a16b38d54421eeeaf73ec89828563be7 |
||
This vulnerability is mitigated in part by the use of -D_FORTIFY_SOURCE=2 in Ubuntu. | ||
python3.7
Launchpad, Ubuntu, Debian |
bionic |
Released
(3.7.5-2~18.04.4)
|
focal |
Does not exist
|
|
groovy |
Does not exist
|
|
hirsute |
Does not exist
|
|
impish |
Does not exist
|
|
jammy |
Does not exist
|
|
kinetic |
Does not exist
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Does not exist
|
|
upstream |
Needs triage
|
|
xenial |
Does not exist
|
|
Patches:
upstream: https://github.com/python/cpython/commit/d9b8f138b7df3b455b54653ca59f491b4840d6fa |
||
python3.8
Launchpad, Ubuntu, Debian |
bionic |
Released
(3.8.0-3~18.04.1)
|
focal |
Released
(3.8.5-1~20.04.2)
|
|
groovy |
Released
(3.8.6-1ubuntu0.2)
|
|
hirsute |
Does not exist
|
|
impish |
Does not exist
|
|
jammy |
Does not exist
|
|
kinetic |
Does not exist
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Does not exist
|
|
upstream |
Needs triage
|
|
xenial |
Does not exist
|
|
Patches:
upstream: https://github.com/python/cpython/commit/ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f |
||
This vulnerability is mitigated in part by the use of -D_FORTIFY_SOURCE=2 in Ubuntu. | ||
python3.9
Launchpad, Ubuntu, Debian |
bionic |
Does not exist
|
focal |
Released
(3.9.5-3~20.04.1)
|
|
groovy |
Released
(3.9.5-3~20.10.1)
|
|
hirsute |
Not vulnerable
(3.9.1-3)
|
|
impish |
Not vulnerable
(3.9.1-3)
|
|
jammy |
Does not exist
|
|
kinetic |
Does not exist
|
|
lunar |
Does not exist
|
|
mantic |
Does not exist
|
|
noble |
Does not exist
|
|
trusty |
Does not exist
|
|
upstream |
Released
(3.9.1-3)
|
|
xenial |
Does not exist
|
|
Patches:
upstream: https://github.com/python/cpython/commit/c347cbe694743cee120457aa6626712f7799a932 |
||
This vulnerability is mitigated in part by the use of -D_FORTIFY_SOURCE=2 in Ubuntu. |
Severity score breakdown
Parameter | Value |
---|---|
Base score | 9.8 |
Attack vector | Network |
Attack complexity | Low |
Privileges required | None |
User interaction | None |
Scope | Unchanged |
Confidentiality | High |
Integrity impact | High |
Availability impact | High |
Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
References
- https://bugs.python.org/issue42938
- https://github.com/python/cpython/pull/24239
- https://python-security.readthedocs.io/vuln/ctypes-buffer-overflow-pycarg_repr.html
- https://ubuntu.com/security/notices/USN-4754-1
- https://ubuntu.com/security/notices/USN-4754-2 (regression in python2.7)
- https://ubuntu.com/security/notices/USN-4754-4
- https://ubuntu.com/security/notices/USN-4754-3
- https://ubuntu.com/security/notices/USN-4754-5
- https://www.cve.org/CVERecord?id=CVE-2021-3177
- https://ubuntu.com/security/notices/USN-6891-1
- NVD
- Launchpad
- Debian