On August 28, 2026, a new npm supply-chain compromise hit @7nohe/openapi-react-query-codegen, a code generator that produces TypeScript clients and TanStack Query hooks from OpenAPI schemas.[1][2][3]
The attacker did not need a maintainer's npm password or a stolen long-lived publish token.
The release workflow itself was the path.
The repository listened for:
issue_comment
and a pull-request comment with the exact body:
npm publish
could trigger the release path without verifying whether the commenter was a maintainer, collaborator, or completely external GitHub user.[1][2]
The workflow then:
checked out PR-controlled code
→ ran pnpm install
→ held id-token: write
→ published through npm Trusted Publishing
The result was especially important: 10 malicious versions were published with valid npm provenance.[1][3]
That gives us one of the clearest software-supply-chain lessons of 2026:
Provenance can correctly prove where a build came from while the build itself is malicious.
There is another correction that matters.
@tanstack/react-query itself was not compromised in this incident. The attacked package is an independent code generator that targets TanStack Query.[6][7]
It is not an official TanStack package.
Information status: August 31, 2026.
TL;DR
| Question | Verified answer |
|---|---|
| What was compromised? | @7nohe/openapi-react-query-codegen |
| Date | August 28, 2026 |
| Malicious versions | 10 |
| Stable malicious versions | 8 |
| Malicious prereleases | 2 |
Was @tanstack/react-query compromised? | No |
| Why is TanStack Query relevant? | The package generates hooks/options for it |
| Main attack vector | Misconfigured GitHub Actions issue_comment release workflow |
| Maintainer npm password required? | No |
| Long-lived npm publish token required? | No |
| Publish authority | id-token: write + npm Trusted Publishing |
| Did malicious releases have provenance? | Yes |
| Does provenance guarantee safe code? | No |
| Main execution paths | binding.gyp, plus preinstall in some versions |
| Main payload file | 3FWCvzduYZg.js |
Current latest | 3.0.2 |
Is 3.0.2 known clean? | Yes |
| Advisory severity | Critical, CVSS 9.6 |
| CVE | No known CVE in the advisory as of Aug 31 |
| Classification | Embedded malicious code / supply-chain compromise |
| Campaign family | Researchers link it to Mini Shai-Hulud-derived activity |
| Operator attribution certain? | No |
| Priority response | Isolate host and rotate all reachable credentials from a clean machine |
What happened on August 28?
GitHub Security Advisory GHSA-9pvf-vcx3-x239 lists 10 malicious versions published between roughly 20:00 and 20:21 UTC.[1]
Eight were stable:
0.5.4
0.5.5
1.6.3
1.6.4
2.2.1
2.2.2
3.0.3
3.0.4
Two were prereleases:
0.0.0-365d4eb738d3146583431948d3ba6e27a32556be
0.0.0-ec7876d6c917dad516ba69bbfafc948b834bf0ab
The malicious latest tag pointed to 3.0.4 from approximately 20:19:29 UTC until about 22:51 UTC, when it was restored to clean 3.0.2.[1]
TanStack Query itself was not compromised
Headlines such as:
TanStack Query hacked
are inaccurate here.
The package:
@7nohe/openapi-react-query-codegen
is an independent project.
It generates code for:
@tanstack/react-query
from an OpenAPI schema.[6]
That is a technology relationship, not package ownership.
The official @tanstack/react-query package remains separate, and TanStack's May postmortem also explicitly listed the Query family as unaffected by that earlier incident.[7][11]
The accurate statement is:
A third-party code generator used with TanStack Query was compromised.
What does the package do?
It generates, among other things:
- typed API clients,
- query keys,
queryOptions,infiniteQueryOptions,useQuery,useMutation,useSuspenseQuery,- prefetch and SSR helpers.
Typical flow:
OpenAPI schema
↓
openapi-react-query-codegen
↓
TypeScript client
↓
TanStack Query hooks/options
It is commonly a development dependency.
That is exactly why it is an attractive target.
A development dependency often runs:
- on a developer laptop,
- in GitHub Actions,
- in a release pipeline,
- in an environment with tokens,
- next to source code,
- close to cloud credentials.
It does not need to reach the browser bundle to cause damage.
How widely used was it?
On August 31, npm showed roughly 155,000 weekly downloads for the scoped package @7nohe/openapi-react-query-codegen.[6]
That number is dynamic and should be treated as a snapshot, not a permanent historical fact.
More important is how the package is used.
A code generator is installed in the development environment, exactly where you can find:
GitHub auth
npm credentials
SSH keys
cloud credentials
CI secrets
source code
The compromise began in GitHub Actions, not npm
The most important flaw was in GitHub Actions.
The release workflow listened for:
on:
issue_comment:
types: [created]
and accepted a specific comment on a pull request.[1]
issue_comment itself is not a vulnerability.
The danger came from the combination of:
external comment
+
no actor authorization gate
+
checkout PR code
+
execute PR code
+
id-token: write
+
publish
Each element can be correct on its own.
Together, the chain created a path from an anonymous GitHub user to an npm publish.
One comment could enter the release path
The workflow mainly checked whether the comment:
- belonged to a pull request,
- had the exact body
npm publish.
The key gate was missing:
does the commenter belong to a trusted group?
For example:
OWNER
MEMBER
COLLABORATOR
That meant an attacker could prepare code in a fork, open a PR and trigger the release with a comment.
This is not a problem with issue_comment itself.
It is a missing authorization check before entering a privileged workflow.
Checking out the fork turned input into execution
Triggering a workflow does not automatically mean attacker code runs.
The next step was the decisive one.
The pipeline checked out pull-request-controlled code and then ran:
pnpm install
From that moment, attacker-controlled repository content stopped being just data.
It became code executed inside a privileged release job.
This is a fundamental security boundary:
untrusted code as data
versus:
untrusted code executed in privileged context
GitHub's security guidance has long warned against executing untrusted PR content in workflows with elevated privileges.[9]
id-token: write opened the path to npm
The workflow had:
permissions:
id-token: write
That is not bad in itself.
It is required for OIDC-based Trusted Publishing.
npm Trusted Publishing lets CI publish a package without storing a long-lived npm token.[10]
That is normally a security improvement.
In this case the question was:
who can cause the privileged workflow to run?
If untrusted code reaches a job that is allowed to mint an OIDC identity, Trusted Publishing ends up trusting a legitimate workflow executing illegitimate code.
No maintainer password theft was required
StepSecurity notes that the attacker did not require:
- a maintainer npm password,
- a long-lived npm publish token.
That is an important change compared with classic account takeover.
The older threat model:
steal token
→ npm publish
The newer model:
influence trusted workflow
→ workflow receives legitimate identity
→ publish
Moving the boundary from the maintainer account to the pipeline matters a great deal for DevSecOps.
Malicious releases had valid provenance
According to the GitHub advisory and Socket's analysis, the releases went through the genuine workflow and npm Trusted Publishing, so the malicious versions carried valid provenance/SLSA provenance.[1][3]
That does not mean provenance failed cryptographically.
Quite the opposite.
Provenance correctly said:
this artifact was published
by this workflow
from this repository
The problem:
the workflow ran attacker-controlled code
Provenance is not malware detection
This is one of the most important lessons of the whole incident.
Provenance answers questions such as:
- where the build came from,
- which workflow built it,
- which repository is the source,
- whether the chain of custody is consistent.
It does not automatically answer:
is the source code safe?
was the PR authorized?
does the workflow have a logic flaw?
does the artifact contain malware?
Therefore:
valid provenance
≠
safe package
npm's own Trusted Publishing documentation presents provenance as origin verification, not as a universal malware verdict.[10]
First execution path: binding.gyp
Some malicious stable releases had no obvious:
"preinstall": "..."
Instead they introduced:
binding.gyp
A package that looks like a native addon can cause npm to run node-gyp rebuild automatically.
The malicious binding.gyp abused GYP's Python expression evaluation to reach os.system() and execute the JavaScript payload.[1][5]
This matters especially for scanners.
The rule:
look only for preinstall/postinstall
is not enough.
Second execution path: explicit preinstall
Later stable malicious releases also included:
{
"scripts": {
"preinstall": "node 3FWCvzduYZg.js"
}
}
Those were:
0.5.5
1.6.4
2.2.2
3.0.4
Earlier stable releases:
0.5.4
1.6.3
2.2.1
3.0.3
used the binding.gyp path without the explicit lifecycle script.[1]
This deliberate variation of triggers makes simple detection based on a single IOC harder.
The two prereleases were different
The two malicious 0.0.0-* prereleases contained a bad preinstall reference, but the setting:
{
"files": ["dist"]
}
excluded the referenced payload files from the tarballs.[1]
So the 10 artifacts should not be treated as byte-identical or as following an identical execution path.
All of them are classified as malicious publications.
But the eight stable releases have the more complete, confirmed set of triggers and payloads.
Main payload: 3FWCvzduYZg.js
Malicious stable tarballs contained:
3FWCvzduYZg.js
at roughly 4.4 to 6.4 MB, depending on the release.[1]
Version 3.0.4 carried a payload of more than 6 MB and an explicit preinstall.[2]
Large, heavily obfuscated JavaScript in a small code generator package is an anomaly signal in itself.
StepSecurity observed that 0.5.4 jumped from about 41 KB in 0.5.3 to more than 5.6 MB.[2]
A sudden package-size delta is a very useful supply-chain signal.
What the payload did at runtime
StepSecurity detonated affected versions in isolated GitHub-hosted runners.[2]
For 3.0.4, observed activity included:
Node starts payload
→ curl downloads Bun
→ Bun executes under /tmp/trinnyyyy-*
→ gh auth token is called
→ Git credential manager queried
→ ssh / scp checked
→ running processes enumerated
→ temporary updater.py invoked
Researchers also observed GitHub API access and probing of the Google Cloud metadata hostname.[2]
This is credential-oriented malware, not an ordinary cryptominer.
Which secrets should be considered exposed?
If the malware runs as a user or CI runner process, its real reach depends on the environment.
It can potentially access whatever the process can access:
GitHub credentials
npm credentials
SSH keys
cloud environment credentials
CI/CD secrets
source repositories
deployment credentials
This does not mean every secret was stolen on every machine.
The accurate wording is:
If an affected version executed, all credentials reachable from that process should be treated as potentially exposed.
Why a dev dependency can be extremely dangerous
A developer may think:
it's only codegen
it never ships to the production bundle
That is the wrong security model.
The payload only needs to run during:
npm install
pnpm install
yarn install
It does not need to reach client code.
A dev dependency can be an even more valuable target, because it runs on machines with:
- SSH,
gh,- cloud CLIs,
.npmrc,- repositories,
- CI tokens.
Package installation is a code-execution surface
Package managers have long supported lifecycle scripts.
Examples:
preinstall
install
postinstall
prepare
Native addon flows may also run tooling like node-gyp.
So package installation is effectively:
dependency resolution
+
download
+
potential code execution
It is not just "copying libraries into node_modules".
That is one of the reasons supply-chain controls must operate before or during installation, not only against the final artifact.
Was TeamPCP definitely behind it?
JFrog, Socket and other researchers connect the malware to the Mini Shai-Hulud family and its later variants.[3][4]
JFrog, however, points to an important uncertainty about the operator.
Similar code, techniques and campaign markers may indicate:
- a continuation of the same operation,
- use of leftover access,
- reuse of publicly available malware,
- a copycat.
We will therefore not write:
a specific operator did this, 100% certain
when the public evidence does not settle it.
Why Mini Shai-Hulud keeps appearing
Mini Shai-Hulud is a supply-chain family/campaign focused on:
- credential theft,
- CI/CD,
- npm,
- GitHub,
- automated propagation.
In May 2026, researchers tracked compromises involving TanStack, Mistral, UiPath and further packages.[12]
In August, similar or derived techniques still appear in new compromises.
The campaign logo is not what matters most.
What matters is the recurring pattern:
enter through the pipeline
→ steal/obtain publish authority
→ publish a trusted artifact
→ execute malware on more developer machines
→ look for the next credentials
The May TanStack attack was a different technical incident
On May 11, 2026, the affected TanStack repository was Router/Start.[11]
The attacker chained:
- a
pull_request_targetpwn-request pattern, - GitHub Actions cache poisoning,
- OIDC token extraction from runner memory.
The result:
42 packages
84 malicious versions
That is not the same root cause as the August 28 compromise.
TanStack Query was clean in May too
After its audit, TanStack's official postmortem stated:
- affected: Router/Start repository,
- unaffected: Query, DB, Store, AI, Table, Form, Virtual and other families.
This matters because in 2026 there were at least two incidents that can be superficially described as:
TanStack supply-chain attack
yet neither justifies automatically saying:
@tanstack/react-query was infected
In August, an independent code generator was attacked.
In May, the Router/Start monorepo was attacked.
The May incident demonstrated real downstream consequences
OpenAI disclosed that two employee devices were affected by the May TanStack/Mini Shai-Hulud incident.[13]
OpenAI reported, among other things:
- credential-focused activity,
- limited credential material exfiltrated from a subset of source repositories,
- no evidence of user-data access,
- no evidence of production-system or IP compromise,
- credential and signing-certificate rotation as a precautionary response.
That history explains why a few minutes of malicious-package exposure can matter even to very mature organizations.
August attack vs May attack
May
fork PR
→ pull_request_target
→ poisoned cache
→ trusted release restores cache
→ OIDC token extracted from runner memory
→ publish
August
fork PR
→ public issue_comment "npm publish"
→ privileged workflow checks out PR
→ pnpm install executes attacker code
→ workflow already has id-token: write
→ Trusted Publishing
The August path is simpler.
No complex cache poisoning was required.
That is exactly what should be most concerning.
How to check whether your project was affected
Start with lockfiles and SBOMs.
Search for the exact versions:
0.5.4
0.5.5
1.6.3
1.6.4
2.2.1
2.2.2
3.0.3
3.0.4
0.0.0-365d4eb738d3146583431948d3ba6e27a32556be
0.0.0-ec7876d6c917dad516ba69bbfafc948b834bf0ab
Check:
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lock
SBOM
CI install logs
dependency cache
Do not only inspect the current package.json.
A floating range may have resolved to a malicious version during the incident window and then returned to the clean latest.
Important IOCs
Public indicators include:[1][2][5]
3FWCvzduYZg.js
binding.gyp
is_it_this_simple.js
nu.js
/tmp/trinnyyyy-*/bun
/tmp/*/updater.py
Also investigate:
- unexpected Bun downloads during install,
gh auth tokencalls,- unusual
git credential-manageractivity, - outbound traffic to GitHub release assets during installation,
- unexpected node-gyp execution in a package that does not need a native addon.
An IOC should not be the only detection method.
The payload can change its name.
Behavioural detection matters more.
What to do after an affected installation
The official advisory and StepSecurity recommend treating the host as potentially compromised.[1][2]
Minimum response:
1. stop builds
2. isolate the host
3. use a separate clean machine
4. rotate all reachable secrets
5. invalidate active sessions
6. review GitHub/npm/cloud audit logs
7. purge dependency caches
8. discard artifacts from the exposed runner
9. rebuild the environment from a clean source
Do not rotate only the npm token.
If the process could see more, the rotation scope must be wider.
Which versions are safe?
The GitHub advisory points to 3.0.2 as patched/known good and says no version published before August 28 is affected by this incident.[1]
StepSecurity lists clean predecessors for each release line:
0.5.3
1.6.2
2.2.0
3.0.2
As of August 31, npm again shows:
latest = 3.0.2
If you have no reason to stay on an older line, the official advisory leads to 3.0.2.
What did upstream change?
According to the GitHub advisory, remediation included:[1]
- removing the
issue_commentrelease trigger, - moving releases to tag push,
- revoking the npm trusted publisher,
- rotating long-lived tokens,
- restoring
latestto3.0.2, - removing the
predist-tag, - deprecating all 10 malicious versions,
- requesting removal from npm security.
That is the right direction:
public interaction
should never be a direct gateway to:
production publish identity
Snyk also classifies the compromise as Critical with CVSS 9.6, reinforcing the severity of install-time malicious-code execution.[8] TanStack's follow-up hardening after the May incident is also relevant context for cache, workflow and release-pipeline defenses.[14]
How to harden GitHub Actions
Do not execute untrusted PR code in privileged jobs
GitHub recommends separating:
untrusted build
from:
trusted action
Require actor authorization
Comment-driven automation needs an explicit authorization gate.
Minimize permissions
If a job does not publish, then:
id-token: write
should not exist there.
Separate build and publish
The safest shape:
untrusted PR CI
↓
artifact treated as data
↓
review / trusted trigger
↓
release
Pin GitHub Actions to a commit SHA
Action tags are also part of the software supply chain.
How to harden dependency installation
There is no single magic switch.
A practical set of controls:
- lockfiles,
- frozen lockfile installs,
- package release cooldown/minimum age,
- monitoring new publishes,
- package-size delta analysis,
- lifecycle-script policy,
- sandboxed CI,
- outbound network policy,
- SCA + malicious-package detection,
- SBOM,
- minimal credentials on runners.
npm Trusted Publishing still makes sense.[10]
But:
Trusted Publishing
must be paired with:
Trusted Workflow Design
Production checklist
Dependencies
- Lockfile is mandatory.
- CI rejects unexpected lockfile changes.
- Minimum release age/cooldown is configured.
- New dependency versions do not reach production automatically.
- Sudden package-size changes are monitored.
- Install scripts are inspected.
-
binding.gypin unusual packages is flagged. - Malicious packages are scanned for, not only CVEs.
GitHub Actions
- Fork code never runs in privileged context.
-
issue_commentworkflows have authorization gates. -
pull_request_targetis used only when necessary. -
GITHUB_TOKENhas minimal permissions. - Only the publish job has
id-token: write. - Publishing requires a trusted trigger.
- Build and publish are separated.
- Actions are pinned to commit SHA.
- Comment-driven automation has a negative test for unauthorized users.
- Release workflows never check out untrusted fork code.
npm
- Trusted Publisher is limited to the minimum workflow set.
- Unnecessary long-lived publish tokens are removed.
- Publishes are monitored in real time.
- Alerts cover new versions outside a planned release.
- Provenance is verified but never treated as a malware verdict.
- In an incident we can deprecate/revoke immediately.
Runners and developer endpoints
- CI runners are ephemeral.
- Workspaces do not contain unnecessary secrets.
- Cloud credentials are short-lived.
- SSH keys have minimal scope.
- Outbound traffic is monitored.
- Dependency installs cannot reach the whole infrastructure.
- Developer endpoints have EDR/runtime monitoring.
- Hosts can be isolated quickly.
Incident response
- The dependency incident response owner is known.
- Lockfiles can be searched historically.
- CI caches can be purged.
- Sessions can be invalidated.
- Credentials reachable from runners are mapped.
- Credential rotation happens from a clean machine.
- npm is checked for unauthorized publishes.
- GitHub audit logs are reviewed after rotation.
POLPROG verdict
The @7nohe/openapi-react-query-codegen compromise is one of the clearest 2026 examples of how software supply-chain security is changing.
The attacker did not need to:
hack npm
steal a maintainer password
defeat 2FA
steal a classic publish token
It was enough for the release workflow to let an untrusted user get their code executed inside a job that had Trusted Publishing authority.
That is a huge difference.
Account security still matters.
But the modern security boundary is moving to:
CI/CD graph
workflow triggers
cache
artifacts
OIDC
release authorization
dependency execution
The second lesson is provenance.
Valid provenance remains valuable.
In this incident, however, it correctly attested the origin of a malicious build.
That is not a cryptographic failure.
It is a consequence of misplaced trust in the workflow.
The third lesson is about naming.
TanStack Query itself was not compromised in this incident.
The attacked package generates code for TanStack Query, but it is an independent project.
The distinction matters, because security reporting should not shift blame or incident scope onto a whole ecosystem just because a library appears in a package name or dependency graph.
As of August 31:
malicious versions: identified
advisory: published
latest: restored to 3.0.2
upstream workflow: changed
But the most important question for every JavaScript team is not:
Did we use this specific package?
It is:
Does our own release pipeline contain a similar path where untrusted input can reach a job with publish authority?
If the answer is not immediately clear, audit your GitHub Actions workflows now.
