Malicious Code in py-randomencode (PyPI)

py-randomencode Updated 02 Oct 2025

Summary

25/02/2023
CRITICAL
No i
Critical
Not published

MAL-2023-5569: Malicious code in py-randomencode (PyPI). Affected versions are not published. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

py-randomencode is a package available on PyPI that provides functionality for random encoding. It is commonly used in Python projects for various purposes such as obfuscation and encryption. However, this package has been found to contain malicious code, making it a potential security risk for any project that includes it.

Vulnerability Detail

The py-randomencode package has been identified as part of a larger group of nearly 6000 malicious PyPi and NPM packages published by the EsqueleSquad group. These packages execute spyware and information-stealing malware, posing a significant threat to the security and privacy of affected systems. The specific vulnerability in py-randomencode allows the execution of arbitrary code, potentially leading to unauthorized access, data theft, or other malicious activities.

How To Fix

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

pip uninstall py-randomencode

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

There is no known workaround for this vulnerability. It is essential to remove the py-randomencode package and replace it with a secure alternative.

Conclusion

The py-randomencode package available on PyPI has been found to contain malicious code as part of a larger group of malicious packages. This vulnerability poses a significant risk to the security and privacy of affected projects. It is crucial to remove the py-randomencode package and replace it with a trusted alternative. Regularly reviewing and updating the packages used in your project is essential to mitigate the risk of other malicious packages. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for py-randomencode →

Share this vulnerability

FAQ

The malicious code in py-randomencode can execute spyware and information-stealing malware, compromising the security and privacy of your project. It is crucial to remove this package to mitigate the risk.

No, all versions of py-randomencode are affected by this vulnerability. It is recommended to remove the package entirely.

Regularly review and update the packages used in your project. Consider using a package vulnerability monitoring tool like Vulert to receive real-time alerts about potential security risks.

For more information about this vulnerability and its impact, you can contact Checkmarx at supplychainsecurity@checkmarx.com or visit their website at https://bit.ly/checkmarx-malicious-packages.

How To Fix

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

pip uninstall py-randomencode

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