CVE-2020-27619:Python 3 through 3.9.0 contains a vulnerability where CJK codec tests execute eval() on HTTP-retrieved content.

splash
Back

Description Preview

In Python 3 through 3.9.0, there is a security vulnerability in the Lib/test/multibytecodec_support.py file. The CJK (Chinese, Japanese, Korean) codec tests in this file call the eval() function on content that is retrieved via HTTP. This creates a potential code execution vulnerability if an attacker can intercept or manipulate the HTTP traffic during testing.

Overview

This vulnerability affects Python 3 through 3.9.0 and is located in the test suite for multibyte character encodings. The specific issue is in the CJK codec tests which use eval() to process content retrieved from HTTP sources. The eval() function is dangerous when used on untrusted input as it can execute arbitrary Python code. In this case, if an attacker can control the HTTP response content during testing, they could potentially execute malicious code with the privileges of the Python process.

While this vulnerability is limited to the test suite and not the core functionality of Python, it still represents a security risk in environments where the tests might be run, especially in automated testing pipelines or development environments.

Remediation

To remediate this vulnerability, users should:

  1. Update to Python 3.9.1 or later versions where this issue has been patched.
  2. If updating is not immediately possible, avoid running the affected tests in untrusted network environments.
  3. Consider implementing network controls to prevent unauthorized access to HTTP traffic during test execution.
  4. For system administrators managing Python installations, ensure that the test suite is not accessible to unprivileged users.

The Python development team has addressed this issue with several patches that modify how the tests handle external content, replacing the unsafe eval() calls with safer alternatives.

References

  1. Python Bug Tracker: https://bugs.python.org/issue41944
  2. Fix Commits:
    • https://github.com/python/cpython/commit/2ef5caa58febc8968e670e39e3d37cf8eef3cab8
    • https://github.com/python/cpython/commit/43e523103886af66d6c27cd72431b5d9d14cd2a9
    • https://github.com/python/cpython/commit/6c6c256df3636ff6f6136820afaefa5a10a3ac33
    • https://github.com/python/cpython/commit/b664a1df4ee71d3760ab937653b10997081b1794
    • https://github.com/python/cpython/commit/e912e945f2960029d039d3390ea08835ad39374b
  3. NetApp Security Advisory: https://security.netapp.com/advisory/ntap-20201123-0004/
  4. Oracle Critical Patch Update: https://www.oracle.com/security-alerts/cpujul2022.html
  5. Fedora Security Announcements:
    • https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RSLQD5CCM75IZGAMBDGUZEATYU5YSGJ7/
    • https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SGIY6I4YS3WOXAK4SXKIEOC2G4VZKIR7/
  6. Gentoo Linux Security Advisory: https://security.gentoo.org/glsa/202402-04

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Manufacturing
    Manufacturing
  2. Health Care & Social Assistance
    Health Care & Social Assistance
  3. Public Administration
    Public Administration
  4. Educational Services
    Educational Services
  5. Finance and Insurance
    Finance and Insurance
  6. Transportation & Warehousing
    Transportation & Warehousing
  7. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  8. Utilities
    Utilities
  9. Retail Trade
    Retail Trade
  10. Other Services (except Public Administration)
    Other Services (except Public Administration)
  11. Information
    Information
  12. Management of Companies & Enterprises
    Management of Companies & Enterprises
  13. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  14. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  15. Accommodation & Food Services
    Accommodation & Food Services
  16. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  17. Construction
    Construction
  18. Mining
    Mining
  19. Wholesale Trade
    Wholesale Trade
  20. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background