---
title: "MAL-2025-190644: Malicious code in @posthog/ai (npm)"
description: "Malicious code in @posthog/ai (npm). Affects @posthog/ai; fixed in 8.22.0."
url: https://inlinr.com/advisories/MAL-2025-190644
lang: en
---

[Packages](https://inlinr.com/packages) / [@posthog/ai](https://inlinr.com/packages/@posthog/ai) / [Security](https://inlinr.com/packages/@posthog/ai/security)

Malicious package MAL-2025-190644 GHSA-mjv6-3w2m-7669 Published 24 Nov 2025

# Malicious code in @posthog/ai (npm)

Your version 

Compromised versions · [@posthog/ai](https://inlinr.com/packages/@posthog/ai)

- 7.1.2

Safe

Every other versionincluding the latest, 8.22.0

```
npm install @posthog/ai@8.22.0
```

8.x 

1. Not affected

8.0.0 – 8.22.0  
93 releases, latest

7.x 

1. Not affected

7.0.0 – 7.1.1  
3 releases
2. Affected

7.1.2  
1 release
3. Safe

7.2.0 – 7.21.0  
115 releases

270 stable releases of @posthog/ai, oldest to newest, one row per major.

## What happens

If one of these versions was installed

1. Treat the machines and CI runners that installed it as compromised.
2. Rotate the npm, GitHub and cloud tokens they could reach.
3. Reinstall from a lockfile that pins a version outside the list.

---

_\-= Per source details. Do not edit below this line.=-_

Source: amazon-inspector (0a9a022b20b3025cb0846139ab6f2a1308025ed8ee902db18aacbfa95c6ea7e6)

The package @posthog/ai was found to contain malicious code.

Source: ghsa-malware (1e6a08419969270cca059f804bb3ec25aa0427f00ef555a9409c12d50921a83c)

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Source: google-open-source-security (7120d00d5f1e13ba8c718d91d15c19a4cfe770b4e2fb00dbac8d8c9ea32844e4)

This package was compromised by the Sha1-Hulud: The Second Coming NPM worm. The malicious payload steals tokens and credentials and publishes them to GitHub. The worm will propogate itself to NPM packages the user owns and establish persistence is a GitHub action. The package may also destroy the user's home directory.

## References

- [GitHub advisory](https://github.com/advisories/GHSA-mjv6-3w2m-7669 "https://github.com/advisories/GHSA-mjv6-3w2m-7669")  
github.com/advisories/GHSA-mjv6-3w2m-7669
- [Reference](https://www.aikido.dev/blog/shai-hulud-strikes-again-hitting-zapier-ensdomains "https://www.aikido.dev/blog/shai-hulud-strikes-again-hitting-zapier-ensdomains")  
aikido.dev/blog/shai-hulud-strikes-again-hittin…
- [Reference](https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack "https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack")  
wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain…
- [Reference](https://www.stepsecurity.io/blog/sha1-hulud-the-second-coming-zapier-ens-domains-and-other-prominent-npm-packages-compromised "https://www.stepsecurity.io/blog/sha1-hulud-the-second-coming-zapier-ens-domains-and-other-prominent-npm-packages-compromised")  
stepsecurity.io/blog/sha1-hulud-the-second-comi…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
