Malicious Code Vulnerability in py-sock2: Remote Code Execution and File Exfiltration

py-sock2 Updated 15 Oct 2026

Summary

15/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17881: Malicious code in py-sock2 (PyPI). Affects py-sock2 versions 0.1.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

py-sock2 is a Python package available on PyPI that is designed for socket programming. It allows developers to create network applications using Python's socket interface. However, a recent malicious version of this package has been identified, which introduces severe security risks, including the ability to execute remote commands and exfiltrate sensitive files from the victim's machine.

Vulnerability Detail

The vulnerability originates from a malicious version of the py-sock2 package, specifically version 0.1.0, which was uploaded by a user identified as kam193. This version installs a persistent job on the victim's machine, allowing the attacker to exfiltrate files and execute remote code. The malicious code is designed to run automatically, making it difficult for users to detect or remove it. The implications of this vulnerability are severe, as it can lead to unauthorized access to sensitive information and control over the victim's system.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

pip uninstall py-sock2

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the py-sock2 package until a secure version is released. If you must use it, consider isolating your environment using virtual environments or containers to limit the potential impact of the malicious code.

Conclusion

The py-sock2 package has been compromised, leading to significant security vulnerabilities that can affect users' systems. It is essential to take immediate action to remove the malicious version and monitor for any signs of compromise. Utilizing tools like Vulert can help in identifying and managing such vulnerabilities effectively.

See every vulnerability recorded for py-sock2 →

Share this vulnerability

FAQ

py-sock2 is a Python package designed for socket programming, enabling developers to create network applications.

You can check if your application is affected by this vulnerability using Vulert's playground at Vulert Scanner, which monitors open-source vulnerabilities in real-time.

Immediately uninstall the package using pip uninstall py-sock2 and monitor your system for any unusual activity.

To prevent future vulnerabilities, regularly update your packages, use tools like Vulert to monitor for vulnerabilities, and review package sources before installation.

The risks include unauthorized access to sensitive files, execution of remote commands, and potential control over the victim's machine.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

pip uninstall py-sock2

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback