Critical Malicious Code Vulnerability in @posthog/cli Package
Summary
MAL-2025-190671: Malicious code in @posthog/cli (npm). Affects @posthog/cli versions 0.5.15. 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
The @posthog/cli package is a command-line interface tool designed for PostHog, an analytics platform that helps businesses understand user behavior. This package allows developers to interact with PostHog's features directly from the command line, streamlining the integration of analytics into applications. However, it has been found to contain malicious code, posing significant security risks to systems using it.
Vulnerability Detail
The vulnerability originates from the presence of embedded malicious code within version 0.5.15 of the @posthog/cli package. This code can compromise any computer that has the package installed, allowing unauthorized access to sensitive information such as secrets and keys. The ramifications of this vulnerability are severe, as it may lead to complete control of the affected system by an external entity. Users are advised to treat any system running this package as fully compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @posthog/cli
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 are no effective workarounds for this vulnerability. The only recommended action is to uninstall the package and secure the system.
Conclusion
The discovery of malicious code in the @posthog/cli package poses a serious threat to users and their systems. Immediate action is required to uninstall the package and secure any compromised information. Regular monitoring for vulnerabilities using tools like Vulert can help prevent future incidents.
See every vulnerability recorded for @posthog/cli →
FAQ
You should uninstall the package immediately and rotate any sensitive information stored on the affected system.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without any signup.
No, there is currently no patched version available for the @posthog/cli package.
Failure to address this vulnerability may result in unauthorized access to your system, leading to data breaches and potential loss of sensitive information.
Yes, you can still use PostHog's web interface and other integrations without the command-line tool.