Skip to main content

Malicious code in @mexc/shared-utils (npm)

0
Medium
Published: 08/14/2026 (08/14/2026, 20:04:39 UTC)
Source: GCVE Database
Product: @mexc/shared-utils

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (c6d793d1ff65b7f5a24e1aa0c176eaa5d83c7870e05cca5b64f22edb9ca7ded7) Package published to the public npm registry under the @mexc scope without evidence of scope ownership. package.json declares a postinstall hook ("postinstall": "node postinstall.js") that runs on any installer whose resolver falls back to the public registry when resolving @mexc/shared-utils. The postinstall script collects host metadata — os.hostname(), os.userInfo().username, process.getuid(), process.cwd(), platform, node version, and multiple npm_* environment variables (npm_config_registry, npm_config_user_agent, npm_execpath, INIT_CWD) — and writes the data to os.tmpdir()/mexc-poc-execution-proof.json. The current shipped script performs local write only with no outbound network call, but the install-time code-execution primitive against any CI/build system that resolves the @mexc scope publicly is the classic dependency-confusion pattern; the author controls the code that runs and can change the payload in any future version.

Affected software

npmghsa
@mexc/shared-utils
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/15/2026, 05:42:52 UTC

Technical Analysis

The @mexc/shared-utils npm package version 1.0.0 includes a postinstall hook that runs automatically when the package is installed. This hook collects various host environment details and writes them to a local file in the temporary directory. The package was published to the public npm registry under the @mexc scope without evidence of legitimate scope ownership, indicating a dependency confusion attack vector. While the current payload only performs local data collection without network exfiltration, the attacker controls the code executed at install time and could update it to perform more harmful actions in the future. This creates a risk for any CI or build system that resolves the @mexc scope publicly and installs this package.

Potential Impact

The immediate impact is limited to local collection of host metadata written to a temporary file during package installation. There is no current network communication or data exfiltration. However, the dependency confusion pattern allows the attacker to run arbitrary code at install time, which could be escalated in future versions to execute malicious payloads, potentially compromising CI/build environments that resolve this package from the public npm registry.

Mitigation Recommendations

No official patch or fix is currently available. Users should avoid installing or resolving the @mexc/shared-utils package from the public npm registry, especially in CI/build environments. Verify ownership of the @mexc scope before trusting packages under it. Monitor dependency resolution configurations to prevent fallback to public registries for private scopes. Since the current payload performs only local writes, immediate risk is low, but caution is advised to prevent future malicious code execution.

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-14049
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a7ff5f6bf8831d53988004c

Added to database: 08/15/2026, 05:15:34 UTC

Last enriched: 08/15/2026, 05:42:52 UTC

Last updated: 09/28/2026, 15:09:07 UTC

Views: 31

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