Malicious Code Injection in pretty-tabulate: A Security Threat
Summary
MAL-2026-1480: Malicious code in pretty-tabulate (PyPI). Affects pretty-tabulate versions 2.37.1 – 2.37.2. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
pretty-tabulate is a Python package available on PyPI that is designed to enhance the presentation of tabular data in a visually appealing format. It allows developers to create well-structured tables with various styling options, making it easier to display data in a readable manner. However, recent findings have revealed that this package is vulnerable to a malicious code injection, which poses a significant security risk to users who incorporate it into their projects.
Vulnerability Detail
The vulnerability originates from the presence of malicious code within the pretty-tabulate package, specifically linked to the color-list package. This malicious code is triggered when pretty-tabulate is used, leading to the execution of hidden code from a third-party package. The malicious intent is clear, as the code is designed to compromise user data, potentially leading to information theft or other harmful actions. The packages were published by accounts that had been inactive for an extended period, suggesting that they may have been hijacked.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall pretty-tabulate
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, users are advised to avoid using the pretty-tabulate package until they have updated to the patched version. Additionally, consider using alternative packages for tabular data presentation that do not have known vulnerabilities.
Conclusion
The discovery of malicious code within the pretty-tabulate package highlights the importance of vigilance in managing open-source dependencies. Users are encouraged to update their packages promptly and utilize tools like Vulert to monitor for vulnerabilities. By taking these steps, developers can help safeguard their applications against potential threats.
See every vulnerability recorded for pretty-tabulate →
FAQ
The vulnerability involves malicious code that is triggered when using the pretty-tabulate package, potentially leading to data theft or other harmful actions.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.
You should immediately update to the latest version of pretty-tabulate by running 'pip install --upgrade pretty-tabulate' in your terminal.
While specific exploits have not been publicly detailed, the malicious intent suggests that the vulnerability could be exploited for data theft or other malicious activities.
Regularly update your dependencies, monitor for vulnerabilities using tools like Vulert, and review the security practices of the packages you use.