[tdb_mobile_menu menu_id="81451" el_class="plato-left-menu" icon_size="eyJhbGwiOjUwLCJwaG9uZSI6IjMwIn0=" icon_padding="eyJhbGwiOjAuNSwicGhvbmUiOiIxLjUifQ==" tdc_css="eyJhbGwiOnsibWFyZ2luLXRvcCI6IjEwIiwibWFyZ2luLWJvdHRvbSI6IjAiLCJtYXJnaW4tbGVmdCI6IjE1IiwiZGlzcGxheSI6IiJ9LCJwaG9uZSI6eyJtYXJnaW4tdG9wIjoiMCIsIm1hcmdpbi1sZWZ0IjoiMCIsImRpc3BsYXkiOiIifSwicGhvbmVfbWF4X3dpZHRoIjo3Njd9" align_horiz="content-horiz-center" inline="yes" icon_color="#ffffff" icon_color_h="#ffffff"][tdb_header_logo align_vert="content-vert-center" url="https://zephyrnet.com" inline="yes" text="Zephyrnet" image_width="eyJwaG9uZSI6IjM1In0=" img_txt_space="eyJwaG9uZSI6IjEwIn0=" f_text_font_size="eyJwaG9uZSI6IjE4In0=" f_text_font_line_height="eyJwaG9uZSI6IjEuNSJ9" f_text_font_weight="eyJwaG9uZSI6IjcwMCJ9" f_text_font_transform="eyJwaG9uZSI6ImNhcGl0YWxpemUifQ==" f_text_font_family="eyJwaG9uZSI6ImZzXzIifQ==" text_color="#ffffff" text_color_h="var(--accent-color)"]
[tdb_mobile_horiz_menu menu_id="1658" single_line="yes" f_elem_font_family="eyJwaG9uZSI6ImZzXzIifQ==" f_elem_font_weight="eyJwaG9uZSI6IjcwMCJ9" text_color="var(--news-hub-white)" text_color_h="var(--news-hub-accent-hover)" f_elem_font_size="eyJwaG9uZSI6IjE0In0=" f_elem_font_line_height="eyJwaG9uZSI6IjQ4cHgifQ==" elem_padd="eyJwaG9uZSI6IjAgMTVweCJ9" tdc_css="eyJwaG9uZSI6eyJwYWRkaW5nLXJpZ2h0IjoiNSIsInBhZGRpbmctbGVmdCI6IjUiLCJkaXNwbGF5Ijoibm9uZSJ9LCJwaG9uZV9tYXhfd2lkdGgiOjc2N30="]
[tdb_mobile_menu inline="yes" menu_id="81451" el_class="plato-left-menu" icon_size="50" icon_padding="0.5" tdc_css="eyJhbGwiOnsibWFyZ2luLXRvcCI6IjEwIiwibWFyZ2luLWJvdHRvbSI6IjAiLCJtYXJnaW4tbGVmdCI6IjE1IiwiZGlzcGxheSI6IiJ9fQ==" icon_color="#ffffff" icon_color_h="#ffffff"]
Zephyrnet Logo
[tdb_header_menu main_sub_tdicon="td-icon-down" sub_tdicon="td-icon-right-arrow" mm_align_horiz="content-horiz-center" modules_on_row_regular="20%" modules_on_row_cats="20%" image_size="td_300x0" modules_category="image" show_excerpt="none" show_com="none" show_date="" show_author="none" mm_sub_align_horiz="content-horiz-right" mm_elem_align_horiz="content-horiz-center" menu_id="81450" show_mega_cats="yes" align_horiz="content-horiz-center" elem_padd="0 30px" main_sub_icon_space="12" mm_width="1192" mm_padd="30px 25px" mm_align_screen="yes" mm_sub_padd="20px 25px 0" mm_sub_border="1px 0 0" mm_elem_space="25" mm_elem_padd="0" mm_elem_border="0" mm_elem_border_a="0" mm_elem_border_rad="0" mc1_title_tag="h2" modules_gap="25" excl_txt="Premium" excl_margin="0 6px 0 0" excl_padd="2px 5px 2px 4px" excl_bg="var(--news-hub-accent)" f_excl_font_size="12" f_excl_font_weight="700" f_excl_font_transform="uppercase" meta_padding="20px 0 0" art_title="0 0 10px" show_cat="none" show_pagination="disabled" text_color="var(--news-hub-white)" tds_menu_active1-line_color="var(--news-hub-accent)" f_elem_font_size="18" f_elem_font_line_height="64px" f_elem_font_weight="400" f_elem_font_transform="none" mm_bg="var(--news-hub-dark-grey)" mm_border_color="var(--news-hub-accent)" mm_subcats_border_color="#444444" mm_elem_color="var(--news-hub-white)" mm_elem_color_a="var(--news-hub-accent-hover)" f_mm_sub_font_size="14" title_txt="var(--news-hub-white)" title_txt_hover="var(--news-hub-accent-hover)" date_txt="var(--news-hub-light-grey)" f_title_font_line_height="1.25" f_title_font_weight="700" f_meta_font_line_height="1.3" f_meta_font_family="fs_2" tdc_css="eyJhbGwiOnsiYm9yZGVyLXRvcC13aWR0aCI6IjEiLCJib3JkZXItcmlnaHQtd2lkdGgiOiIxIiwiYm9yZGVyLWJvdHRvbS13aWR0aCI6IjEiLCJib3JkZXItbGVmdC13aWR0aCI6IjEiLCJib3JkZXItY29sb3IiOiJ2YXIoLS1uZXdzLWh1Yi1kYXJrLWdyZXkpIiwiZGlzcGxheSI6IiJ9fQ==" mm_border_size="4px 0 0" f_elem_font_family="fs_2" mm_subcats_bg="var(--news-hub-dark-grey)" mm_elem_bg="rgba(0,0,0,0)" mm_elem_bg_a="rgba(0,0,0,0)" f_mm_sub_font_family="fs_2" mm_child_cats="10" mm_sub_inline="yes" mm_subcats_posts_limit="5"]
Home Big Data 5 years old Python vulnerability in the tarfile module affects more than 350,000 projects

5 years old Python vulnerability in the tarfile module affects more than 350,000 projects

0
5 years old Python vulnerability in the tarfile module affects more than 350,000 projects
  • A Python vulnerability discovered in the tarfile module impacts hundreds of thousands of open source projects, posing supply chain security concerns, according to Trellix.
  • CVE-2007-4559, the Python vulnerability, was discovered in 2007 and is still present in the tarfile module.
  • The Trellix Advanced Research Center uncovered the route traversal attack vulnerability while investigating another vulnerability.
  • The vulnerability CVE-2007-4559 affects around 350,000 open-source projects and an unknown number of closed-source projects, raising worries about software supply chain attacks.

According to Trellix, a Python vulnerability in the tarfile module found over 15 years ago still affects hundreds of thousands of open source projects today, increasing supply chain security issues. The flaw, CVE-2007-4559, was identified in 2007 and is still present in the module.

Table of Contents

Possible effects of CVE-2007-4559 Python vulnerability

During a study into another vulnerability, the Trellix Advanced Research Center discovered the route traversal attack vulnerability. CVE-2007-4559 has an impact on around 350,000 open-source projects and an unknown number of closed-source projects, raising concerns about software supply chain assaults. According to NCC Group, assaults on global supply chain businesses surged by 51% between July and December 2021.

“When we talk about supply chain threats, we typically refer to cyber-attacks like the SolarWinds incident, however building on top of weak code foundations can have an equally severe impact,” said Christiaan Beek, Trellix’s Head of Adversarial & Vulnerability Research.

Python Vulnerability In The Tarfile Module (Cve-2007-4559) Affects More Than 350,000 Projects
CVE-2007-4559 Python vulnerability has an impact on around 350,000 open-source projects and an unknown number of closed-source projects

Aside from machine learning, automation apps, and docker containerization, AWS, Google, Intel, Facebook, and Netflix use Python’s susceptible tarfile module for specialized frameworks. Unless otherwise specified, the tarfile module is the default setup in any Python-based project.

“This vulnerability’s pervasiveness is furthered by industry tutorials and online materials propagating its incorrect usage. It’s critical for developers to be educated on all layers of the technology stack to properly prevent the reintroduction of past attack surfaces.”

What is CVE-2007-4559 Python vulnerability?

CVE-2007-4559 allows for the execution of arbitrary code. Although CVE-2007-4559’s CVSS score of 5.1 indicates that it is a medium severity vulnerability, Trellix claims that its attack is quite simple and may be exploited with as few as six lines of code.

The Python tarfile module allows developers to read and write tar archives, which are a UNIX-based tool for packaging uncompressed or compressed (using gzip, bzip2, etc.) files together for backup or distribution.

Because of a few “un-sanitized” lines of code in tarfile, the 2007 path traversal vulnerability still exists. The tarfile.extract() and tarfile.extractall() routines are written without any safeguards to sanitize or examine the path sent to them for file extraction from tar archives.


Microsoft disclosed a TikTok vulnerability deemed “high-severity”


So when a user passes a TarInfo object while calling these extract functions, it causes directory traversal. In other words, it extracts files from a source specified to it without performing the appropriate safety check.

“This vulnerability is incredibly easy to exploit, requiring little to no knowledge about complicated security topics. Due to this fact and the prevalence of the vulnerability in the wild, Python’s tarfile module has become a massive supply chain issue threatening infrastructure around the world,” said Kasimir Schulz, Trellix Threat Labs vulnerability researcher.

Charles Mcfarland, vulnerability researcher in Trellix’s Advanced Threat Research team noted, “Not only has this vulnerability been known for over a decade, the official Python docs explicitly warn to ‘Never extract archives from untrusted sources without prior inspection’ due to the directory traversal issue.”

Python Vulnerability In The Tarfile Module (Cve-2007-4559) Affects More Than 350,000 Projects
Official warning regarding this Python vulnerability, Source: Trellix

Vulnerable projects that are on GitHub

There are 588,840 distinct projects/repositories on GitHub that have ‘import tarfile’ in their python code. However, 61% of these repositories did not complete tarfile member cleaning before being processed, bringing the total number of susceptible repositories to 350,000.

Trellix further noted that because machine learning technologies such as GitHub CoPilot are trained on unsecured GitHub projects, they “are learning to do things insecurely. Not from any fault of the tool but from the fact that it learned from everyone else.”

Python Vulnerability In The Tarfile Module (Cve-2007-4559) Affects More Than 350,000 Projects
GitHub CoPilot auto-completing the vulnerable code, Source: Trellix

Trellix’s research of CVE-2007-4559 Python vulnerability affected project domains showed the following:

Python Vulnerability In The Tarfile Module (Cve-2007-4559) Affects More Than 350,000 Projects
Percentage of the industries that are affected by the Python vulnerability, Source: Trellix

It should be emphasized that Trellix’s vulnerability research is confined to GitHub. As a result, the 15-year-old vulnerability is likely to harm other projects as well. Hundreds of suppliers can contribute applications, independent code, software, libraries, and other dependencies in the software supply chain. 

When vulnerable dependencies, such as the tarfile module, are integrated with third-party providers, service providers, contractors, resellers, and so on, the attack surface of everyone in the chain is expanded while the security fabric of even those with appropriate security hygiene practices is weakened.

Douglas McKee, principal engineer and director of vulnerability research for Trellix Threat Labs, asks “While we can’t provide as detailed an analysis [of closed-source projects] as we can with open-source projects, it is fair to expect the trend to be similar. What if 61% of all projects — open- and closed-source — could be exploited due to this vulnerability?”


Alleged cybersecurity issues of Twitter are causing a headache for the firm


Also adding, “To do our part, Trellix is releasing a script which can be used to scan one or multiple code repositories looking for the presence and likelihood of exploitation for CVE-2007-4559. Additionally, we are working on automating submissions of pull requests to open-source projects which can be confirmed to be exploitable.”

Python Vulnerability In The Tarfile Module (Cve-2007-4559) Affects More Than 350,000 Projects
When vulnerabilities such as Python vulnerability CVE-2007-4559 are integrated with third-party organizations, the security of all are weakened

Trellix supports automated bulk repository forking, cloning, code analysis, patching, commits, and pull requests. The company’s patches for 11,005 repositories are ready for pull requests. Trellix is working on fixes for further projects.

“The number of vulnerable repositories we found begs the question, which other N-day vulnerabilities are lurking around in OSS, undetected or ignored for years? If this tarfile vulnerability is any indicator, we are woefully behind and need to increase our efforts to ensure OSS [open source software] is secure,” McFarland added.

Refer to Trellix’s GitHub docs to see if your project/repository is susceptible to CVE-2007-4559 Python vulnerability.

Chat with us

Hi there! How can I help you?