Critical Malicious Code Vulnerability in @posthog/nuxt Package
Summary
MAL-2025-190749: Malicious code in @posthog/nuxt (npm). Affects @posthog/nuxt versions 1.2.9. 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/nuxt package is a JavaScript library designed for integrating PostHog analytics into Nuxt.js applications. It provides developers with tools to track user interactions and gather analytics data seamlessly. However, this package has been identified to contain malicious code, posing significant security risks to any application utilizing it.
Vulnerability Detail
The vulnerability originates from the presence of embedded malicious code within the @posthog/nuxt package, specifically version 1.2.9. This code can compromise any computer that has the package installed, allowing unauthorized access to sensitive information such as secrets and keys. The implications of this vulnerability are severe, as it may lead to full control of the affected system by an external entity, making it critical for users to act swiftly.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @posthog/nuxt
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 workaround, if you need to maintain analytics functionality, consider using an alternative analytics package that does not have known vulnerabilities. Ensure to review the package's security history before integrating it into your project.
Conclusion
The discovery of malicious code in the @posthog/nuxt package poses a serious threat to users. Immediate action is required to uninstall the package and secure any sensitive information. Users are encouraged to explore alternative solutions for analytics to ensure the safety of their applications.
See every vulnerability recorded for @posthog/nuxt →
FAQ
Immediately uninstall the package using 'npm uninstall @posthog/nuxt' and rotate any sensitive information stored on the affected system.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.
No, there is currently no patched version available for the @posthog/nuxt package. The only solution is to remove it.
Failing to address this vulnerability can lead to unauthorized access to your system, data breaches, and potential loss of sensitive information.
Yes, you can use PostHog's API directly or explore alternative packages that provide similar functionality without the associated risks.