# CVE-2026-46412: Malicious code in @beproduct/nestjs-auth (0.1.2 through 0.1.19) — Mini Shai-Hulud worm

> Attackers injected malicious code into a NestJS authentication library to steal credentials, requiring immediate package removal and credential rotation.

- **Severity:** Critical 10.0 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 20 Jul 2026
- **Updated:** 20 Jul 2026
- **Also known as:** GHSA-6xwp-cp5h-q856

## What is CVE-2026-46412?

CVE-2026-46412 is a critical vulnerability in beproduct-org-nestjs-auth, published on 20 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@beproduct/nestjs-auth is a NestJS authentication module for BeProduct IDS (Identity Server) with OpenID Connect support. Between 2026-05-11 20:19 UTC and 22:56 UTC, an attacker used a compromised npm publish token to publish 18 malicious versions of `@beproduct/nestjs-auth` (0.1.2 through 0.1.19). The postinstall payload attempted to harvest npm tokens (from `~/.npmrc`);  GitHub personal access tokens, OAuth tokens (`gho_*`), and Actions OIDC tokens; AWS credentials (from environment variables and `~/.aws/credentials`); HashiCorp Vault tokens; and other secrets present in environment variables. Version `0.1.20` is a clean republish from the original `0.1.1` source tree. Anyone who installed any version in the range `>=0.1.2 <=0.1.19` should remove the package and clean the npm cache; install the clean version; rotate every credential present in the install environment, including all npm publish tokens, all GitHub PATs and OAuth tokens, AWS access keys, HashiCorp Vault tokens, and any other secret that was in env vars or config files at install time; scan affected hosts for indicators of compromise and, if any are found, treat the host as compromised and reimage; and check committed repository history for unexpected additions in `.claude/` or `.vscode/` directories. The worm is known to commit `setup.mjs` + hook configs to PR branches via automated agent runtimes.

Weakness: CWE-506 (Embedded Malicious Code)

## Which versions are affected by CVE-2026-46412?

2 open source packages ship an affected version, including @beproduct/nestjs-auth.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@beproduct/nestjs-auth` | npm | From 0.1.2 to 0.1.19 | None |
| `@beproduct/nestjs-auth` | npm | From 0.1.2 to 0.1.19 | None |

## How do I fix CVE-2026-46412?

No fix has been published for CVE-2026-46412 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-46412 being exploited?

There is no known exploitation of CVE-2026-46412 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-46412 and fix it if it is affected.

What it is: CVE-2026-46412 is a critical vulnerability in beproduct-org-nestjs-auth, published on 20 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-46412 in the wild and no public exploit code.

Affected packages and fixed versions:
- @beproduct/nestjs-auth (npm): affected from 0.1.2 up to 0.1.19; no fix listed
- @beproduct/nestjs-auth (npm): affected from 0.1.2 up to 0.1.19; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-46412/ (Markdown: https://insights.sbomify.com/CVE-2026-46412/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-46412
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-46412
- OSV: https://osv.dev/vulnerability/CVE-2026-46412

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-46412/
Summaries are generated and may contain mistakes; the official description above is the record.
