1-minute read of a 5 min report

Compromised npm Code Generator Steals Developer and Cloud Credentials

By

1-minute read

What a defender needs to know

Ten malicious releases of @7nohe/openapi-react-query-codegen executed during installation while carrying valid npm provenance. An untrusted account could comment npm publish on a pull request; the release workflow then checked out fork code and published it with id-token: write.

The first wave used binding.gyp to start the node runtime with 3FWCvzduYZg.js as its input. Later releases added the same loader launch through preinstall. Socket’s static analysis found credential discovery, workflow modification, package poisoning, persistence and SSH propagation. The researchers did not execute the recovered payloads, and they did not quantify how many systems installed an affected version.

Search lockfiles and SBOMs with npm ls @7nohe/openapi-react-query-codegen. Affected versions are 0.0.0-365d4eb738d3146583431948d3ba6e27a32556be, 0.0.0-ec7876d6c917dad516ba69bbfafc948b834bf0ab, 0.5.4, 0.5.5, 1.6.3, 1.6.4, 2.2.1, 2.2.2, 3.0.3 and 3.0.4.

Isolate any host or runner that installed one of them. Remove persistence or rebuild before rotating reachable GitHub, registry, cloud, CI and developer-tool credentials. Clear caches and reinstall from a clean lockfile pinned to known-good 0.5.3, 1.6.2, 2.2.0 or 3.0.2.

Verification should show one known-good version, no affected transitive copy, no listed persistence artifact and no unexplained repository or release activity from rotated identities.

Primary sources