Malicious code in forge-gas-diff (npm)
The npm package forge-gas-diff contained malicious code that masqueraded as a Foundry gas-report diff utility. On module load, it scheduled a hidden network request to fetch remote configuration from an attacker-controlled GitHub gist, with capability to persist C2 configuration and generate per-host install fingerprints.
- Disclosed
- Last updated
- Blast radius
- All npm users who installed forge-gas-diff
- Ecosystems
- Attack vectors
- Affected entities
- forge-gas-diffnpm package published by danird9
The npm package forge-gas-diff, published under the account danird9, contained undocumented malicious code disguised as a legitimate Foundry gas-report diff utility. Upon module load or CLI execution, the package scheduled a setTimeout callback for 259,200,000 milliseconds (3 days) that would perform an HTTPS GET request to a GitHub gist hosted on an unrelated account (opensource-crypto).
The malicious behavior included: (1) fetching remote configuration from an attacker-controlled gist at https://gist.githubusercontent.com/opensource-crypto/3946ef88aa057c9d10f1a7d80391d164/raw/default.json; (2) persisting any c2 field from the fetched JSON to ~/.forge-gas-diff.remote for later use; (3) generating and storing a per-host UUID in ~/.forge-gas-diff as a stable install fingerprint. None of this functionality relates to the advertised gas-diff utility purpose.
The 3-day delay was designed to evade typical install-time sandboxing, while the use of an author-mutable GitHub gist provided an attacker-controlled update channel that could be modified without republishing the package. This architecture represents a staging mechanism for a remote-config-driven dropper, establishing persistence and fingerprinting infrastructure on infected systems.
The malicious package was identified and reported by the OpenSSF.
Indicators of compromise
- Packages
- forge-gas-diff
- Domains
- gist.githubusercontent.com
Remediation
- Immediately uninstall forge-gas-diff from all systems
- Remove any ~/.forge-gas-diff and ~/.forge-gas-diff.remote files
- Audit npm package.json and lock files for presence of forge-gas-diff
- Review npm audit logs for installation timestamps
- Monitor affected systems for unexpected outbound HTTPS connections to gist.githubusercontent.com
- Consider rotating any credentials or sensitive data that may have been accessible on affected machines
- Use npm security tools to scan for other potentially malicious packages
Sources
- GitHub Advisory GHSA-83mr-hgqj-5xw3 · GitHub Advisory Database
Cite this entry
"Malicious code in forge-gas-diff (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 7, 2026; last updated August 7, 2026. https://supplychainattack.org/incident/malicious-code-in-forge-gas-diff-npm-bmjoxa
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in pfp-forms-sme-loan (npm)
The npm package pfp-forms-sme-loan contains malicious code that executes a hidden loader on import, downloading and running platform-specific native payloads from attacker-controlled Cloudflare Workers hosts or reconstructing them via DNS TXT records under well1.site. Any system that imported this package should be considered compromised.
npmCompromised packageMalicious commit - resolvedcritical
Malicious code in @velliajs/discord (npm)
@velliajs/discord, a malicious npm package masquerading as a discord.js clone, contained two hostile mechanisms: an unpinned private git dependency with embedded GitHub PAT enabling arbitrary code injection on install, and a hidden runtime kill-switch that gates bot functionality based on a remote allow-list. Two live GitHub Personal Access Tokens were hardcoded in the package.
npmCompromised packageMalicious commit - containedcritical
Malicious code in @wololasod/tiny-id (npm)
The npm package @wololasod/tiny-id contained obfuscated malicious code that downloads and executes platform-specific remote executables on Windows and Linux systems. The dropper was embedded in both the main entry point (dist/index.cjs) and the TypeScript types file (dist/index.d.ts), disguised as a tiny ID generator.
npmCompromised packageMalicious commit - resolvedcritical
Malicious code in twilio-hackerone-poc-afe6937c (npm)
The npm package twilio-hackerone-poc-afe6937c contained malicious preinstall/postinstall scripts that exfiltrate host metadata and environment variables to an external webhook, spawn a persistent daemon process, and attempt cross-tenant code injection in shared environments.
npmCompromised packageMalicious commit