MAL-2026-6256
Malicious code in @withgoogle/stitch-sdk (npm)
Details
@withgoogle/stitch-sdk is a scope-squatting package on npm that impersonates Google's Stitch AI design tool SDK. The attacker registered the @withgoogle scope to mimic Google's withgoogle.com domain and published versions 0.1.1 and 0.1.2 under the account maximus-mcmillan on June 19, 2026. The package runs a credential harvester from a preinstall hook (scripts/preinstall.js) and an identical CLI binary (bin/cli.js). On install it scrapes email addresses and credentials from Claude Code authentication, git config, ~/.git-credentials, ~/.ssh/*.pub, the GitHub CLI, ~/.npmrc, and ~/.docker/config.json, then exfiltrates them to https://stitch-production.org/api/v1 over HTTPS with TLS verification disabled (rejectUnauthorized: false). The code is unobfuscated and relies on the trust of the @withgoogle scope name.
--- _-= Per source details. Do not edit below this line.=-_
## Source: amazon-inspector (ffe3e7f674ed72b1e7f4cc8f75f8040e8e2efd91c98f3b0484dfdc7fe5347279) Package is published under the @withgoogle npm scope but the package.json author is 'Maximus McMillan' with repository github.com/maximus-mcmillan/stitch-sdk — there is no Google affiliation. scripts/preinstall.js runs automatically on `npm install` and enumerates installer-side identity and credential sources: git config user.email (--global/--system), ~/.gitconfig, ~/.config/git/config, ~/.git-credentials (which stores plaintext https://user:token@host entries), ~/.ssh/*.pub, `gh api user`, `claude auth status`, `npm config get email`, ~/.npmrc (npm auth tokens), and ~/.docker/config.json (registry auth). The harvested values are HTTP-GET'd to https://stitch-production.org/api/v1?src=...&user=... with TLS verification explicitly disabled (rejectUnauthorized:false at scripts/preinstall.js:46) to ensure delivery. The hardcoded C2 base URL is at scripts/preinstall.js:26 (`const STITCH_SERVER_BASE = 'https://stitch-production.org/api/v1'`). The combination of @withgoogle scope impersonation, preinstall lifecycle execution, enumeration of canonical credential-file paths, and exfiltration to an attacker-controlled host with TLS verification disabled is a deliberate supply-chain attack against any developer or build system that installs this package.
## Source: ghsa-malware (7ca78e4d79f70f0722c7488bb22b73d1f7bd434e9daefc55de82bbdf437b9294) 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.
Are you affected?
Enter the version of the package you're using.
Affected packages
0 No fixed version published yet for @withgoogle/stitch-sdk (npm). Pin to a known-safe version or switch to an alternative.
References
- https://safedep.io/withgoogle-stitch-sdk-scope-squat-credential-harvester/ [REPORT]
- https://www.npmjs.com/package/@withgoogle/stitch-sdk/v/0.1.5 [PACKAGE]
- https://www.npmjs.com/package/@withgoogle/stitch-sdk/v/0.1.4 [PACKAGE]
- https://www.npmjs.com/package/@withgoogle/stitch-sdk/v/0.1.1 [PACKAGE]
- https://www.npmjs.com/package/@withgoogle/stitch-sdk/v/0.1.3 [PACKAGE]
- https://www.npmjs.com/package/@withgoogle/stitch-sdk/v/0.1.2 [PACKAGE]
- https://github.com/advisories/GHSA-c9hc-fqm6-wjj7 [ADVISORY]