Skip to main content
blockchainsupply-chain-attacknpm-security +5

When Your Trusted Maintainer Isn't: The Injective Labs npm Hijack Is a Warning Shot for Every Crypto SDK

Injective Labs npm supply chain attack used a legitimate maintainer account and OIDC pipeline to steal crypto wallet keys. What DevSecOps teams must fix now.

Supply chain attackers just proved they don’t need to phish a junior dev or squat a typo’d package name — they can walk in through the front door of a legitimate repo, using a legitimate maintainer’s account, and ride a legitimate OIDC pipeline all the way to the npm registry. That’s exactly what happened to Injective Labs on July 8, 2026, and if you’re shipping anything that touches a private key, you should be reading the postmortem with a highlighter.

Unknown threat actors compromised the Injective Labs SDK GitHub repository and used it to publish @injectivelabs/SDK-ts@1.20.21 to npm, a version laced with fake telemetry code designed to exfiltrate cryptocurrency wallet private keys and mnemonic seed phrases. Version 1.20.21 was also pushed across 17 additional @injectivelabs-scoped packages that pinned the poisoned SDK, sweeping transitive consumers into the blast radius. The package has since been deprecated, and a clean 1.20.23 is out — but per the original reporting, the compromised release artifacts remain downloadable from GitHub as of writing.

How a Trusted Maintainer Became the Attack Vector

According to Socket, the malicious functionality landed in the official GitHub repository via commits authored by “a developer with an established history of contributions.” StepSecurity added the crucial detail: the release rode the repository’s own trusted-publisher (OIDC) pipeline, under the identity of existing maintainer thomasRalee. In other words, every automated check that asks “is this coming from the right place, signed by the right person, through the right pipeline?” returned green.

This matters because the industry spent the last three years selling OIDC-based trusted publishing as the fix for npm token theft. It is a fix — for one specific class of attack. It does nothing when the attacker is operating as the maintainer, whether through credential compromise, session hijacking, or a malicious insider. If you’re a security lead who greenlit “trusted publishing = solved,” this incident is your homework.

Imagine your team runs a DeFi dashboard that imports @injectivelabs/wallet-core two levels deep in your dependency tree. You never touched SDK-ts directly, you never bumped a version, and yet a pnpm install on July 9 pulled a wallet stealer into your build. Our take: expect at least one major registry — npm, PyPI, or crates.io — to roll out mandatory multi-reviewer release attestations for high-risk package scopes within the next twelve months, because trusted publishing alone is no longer enough.

Why the trackKeyDerivation() Trick Worked So Well

The malware itself is not clever in the exploit-development sense. It’s clever in the social-engineering sense. It modified legitimate key-generation functions to call a trackKeyDerivation() helper, described in the code as innocuous performance telemetry: “Tracks which key derivation methods are used (hex vs mnemonic) and derives timing patterns to help the SDK team identify performance bottlenecks… All metrics are fire-and-forget and never block or affect key derivation.” A reviewer scrolling through a diff at 4pm on a Wednesday would nod and move on.

The payload deliberately avoided npm lifecycle scripts, which is where most automated scanners look first. It only fires when a real developer actually uses the wallet functions, meaning sandboxed CI installs and dependency-scanning bots see nothing suspicious. Per Socket, the parameters passed to the function include a hard-coded marker for the derivation method plus the sensitive input material — enough to reconstruct the private key server-side. To keep network noise down, the exfiltration batches multiple derivations over a two-second window into a single HTTPS POST to testnet.archival.chain.grpc-web.injective[.]network, a domain crafted to blend into legitimate Injective infrastructure traffic.

If you’re a wallet integrator, here’s the pattern to watch: attackers are no longer dropping obvious child_process.exec calls into postinstall hooks. They’re writing plausible-looking observability code that hides in the exact functions you least want instrumented. Prediction: within the next year, we’ll see the first wave of SAST rules specifically flagging any network egress originating from cryptographic primitive functions, regardless of how benign the surrounding comments look.

What This Means for Everyone Shipping Sensitive SDKs

The Injective incident is a template that will get reused. Any package whose core purpose is handling secrets — wallet SDKs, KMS clients, auth libraries, payment tokenizers — is now a high-value hijack target where the payload can hide in plain sight as “telemetry.” OX Security put it bluntly: “The malware adds crypto wallet stealing logic to a crypto wallet package.” Malware in a payments SDK will look like fraud analytics. Malware in a healthcare SDK will look like HIPAA audit logging.

For teams building in regulated verticals — the kind of work covered in healthcare software engineered for compliance or auditable supply chain systems — dependency trust needs to be an ongoing runtime concern, not a one-time procurement check. If you’re a fintech team using Injective’s SDK, the remediation path is clear: upgrade to 1.20.23, treat any private key or mnemonic phrase that passed through the compromised version as burned, rotate everything, and audit your lockfile for transitive references. If you’re anyone else, the takeaway is that pinning versions in your lockfile is defense, not paranoia — and a good moment to revisit the tradeoffs between immutable ledgers and mutable databases when deciding where key material and audit trails should actually live.

Our take: the next twelve months will separate teams that treat SBOMs as a compliance checkbox from teams that actually diff them on every build. The former will get hit. The latter will catch the next Injective a day earlier.

FAQ

Q: What is the Injective Labs npm compromise? A: On July 8, 2026, attackers who had gained access to the Injective Labs GitHub repository published a poisoned version (1.20.21) of @injectivelabs/SDK-ts and 17 related packages to npm. The malicious code, disguised as telemetry, exfiltrated cryptocurrency wallet private keys and mnemonic seed phrases to an attacker-controlled server.

Q: How do I know if my project is affected? A: Check your lockfile for any @injectivelabs-scoped package at version 1.20.21. Because 17 sibling packages pinned the compromised SDK version, you can be exposed transitively even if you never imported SDK-ts directly. Socket, OX Security, and StepSecurity have all published indicator lists. Any wallet or key material that touched the vulnerable version should be treated as compromised and rotated.

Q: Why didn’t trusted publishing (OIDC) prevent this? A: Trusted publishing verifies that a release comes from the expected CI pipeline on the expected repository. It does not verify that the underlying commits are benign, or that the maintainer’s account hasn’t been compromised. In this case, the malicious commits were authored under an established maintainer’s identity, so every automated trust check passed.

Key Takeaways

  • Audit every @injectivelabs-scoped dependency in your lockfile for version 1.20.21, upgrade to 1.20.23, and rotate any key material that passed through the compromised code path.
  • Treat OIDC-based trusted publishing as one layer, not the whole answer — add multi-reviewer requirements and release attestations for any package that handles secrets.
  • Add SAST or code-review rules that flag network egress originating inside cryptographic or key-derivation functions, regardless of surrounding comments.
  • Assume the next high-profile supply chain attack will hide inside plausible-looking observability code in a regulated-vertical SDK; write your review checklists accordingly.
  • Diff your SBOM on every build. Teams doing this will catch the next Injective-style compromise before the exfiltration server ever sees a beacon.

Have a project in mind?

Tell us what you're building — we reply within 24 hours.