Skip to main content

Malicious code in forge-gas-diff (npm)

0
High
Published: 08/07/2026 (08/07/2026, 12:09:35 UTC)
Source: GCVE Database
Product: forge-gas-diff

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (4b1f6143f5a7c6106ab4ba0a21a6adaf9020e332835b1e528de6f36b64537734) index.js is advertised as a Foundry gas-report diff utility but on module load / CLI run schedules a setTimeout of 259,200,000 ms (3 days) that calls https.get against https://gist.githubusercontent.com/opensource-crypto/3946ef88aa057c9d10f1a7d80391d164/raw/default.json. The gist is hosted on a GitHub account (opensource-crypto) unrelated to the declared package publisher (danird9). If the fetched JSON contains a `c2` field, the value is persisted to ~/.forge-gas-diff.remote for later use. A separate getInstallId() routine writes a per-host UUID to ~/.forge-gas-diff, providing a stable install fingerprint. None of this behavior — outbound network fetch, install-ID generation, remote-config persistence, or a field literally named `c2` — has any relationship to the advertised gas-diff functionality and is not documented in the package. The gist is author-mutable, so the content delivered to installers can be changed at any time without republishing the package; the 3-day delay places the fetch well outside typical install-time sandboxing windows. The mechanism is the staging half of a remote-config-driven dropper: a hidden update channel keyed to attacker-editable content on a third-party host, with persistence to a well-known filesystem path on the installer's machine.

Affected software

npmghsa
forge-gas-diff
Affected versions
=1.0.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/07/2026, 15:49:31 UTC

Technical Analysis

The forge-gas-diff npm package version 1.0.0 includes hidden malicious functionality. Upon module load or CLI execution, it schedules a setTimeout for 3 days to fetch JSON data from a GitHub gist hosted by an account unrelated to the package publisher. If the fetched JSON contains a 'c2' field, its value is persisted to a local file (~/.forge-gas-diff.remote). Additionally, a per-host UUID is generated and stored (~/.forge-gas-diff) to fingerprint the installation. This mechanism acts as a remote-config-driven dropper, allowing the attacker to change the gist content at any time without republishing the package, effectively creating a hidden update channel. These actions are not documented and have no relation to the package's advertised gas-diff functionality.

Potential Impact

This malicious behavior enables an attacker to remotely control or influence the compromised system by delivering arbitrary commands or payloads via the mutable GitHub gist. The persistence of a unique install ID allows tracking or targeted attacks. The delayed fetch evades typical install-time sandboxing, increasing the risk of undetected compromise. While no active exploits are reported, the package's design facilitates stealthy remote control and potential further malicious payload delivery.

Mitigation Recommendations

Users should immediately uninstall the forge-gas-diff package version 1.0.0 and avoid using this package from untrusted sources. Since no patch or official fix is available, remediation involves removing the package and deleting the files ~/.forge-gas-diff and ~/.forge-gas-diff.remote to remove persisted data. Monitor for any unusual network activity related to this package and verify dependencies before installation to prevent similar supply chain attacks.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-13516
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a75f712bf8831d53984fc2a

Added to database: 08/07/2026, 15:17:38 UTC

Last enriched: 08/07/2026, 15:49:31 UTC

Last updated: 09/20/2026, 21:47:08 UTC

Views: 32

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses