Skip to main content

Malicious code in chai-as-synced (npm)

0
High
Published: 06/26/2026 (06/26/2026, 02:51:34 UTC)
Source: GCVE Database
Product: chai-as-synced

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (be17d22b28dc53ea46085190c1f5ff11ae16ce4b80539162d68c2ad2b224158e) [email protected] impersonates the pino logger: it ships pino's README, LICENSE, docs/, index.d.ts and lib/ file layout (proto.js, levels.js, redaction.js, transport.js, worker.js, tools.js, multistream.js) with pino's keywords (`fast`,`logger`,`stream`,`json`), while package.json declares an unrelated name and author (Robert King <[email protected]>, bugs URL https://jsonspack.com/issues) and a boilerplate description unrelated to logging. index.js unconditionally executes `require('./lib/config')` at module top level. lib/config.js is not pino's config module; it is a ~4MB single-line obfuscator.io bundle (rotated string array of ~23,868 entries, hex-escaped identifiers, control-flow flattening, nested decoder functions) that auto-runs the moment any consumer imports the package. The package also declares `axios ^1.10.0` as a runtime dependency although the visible wrapper (a no-op express middleware) has no HTTP use, positioning the hidden payload to perform network I/O at import. The combination of deceptive identity, hidden obfuscated payload, import-time auto-execution, and a bundled HTTP client is a covert-code-execution shape inconsistent with any legitimate logging library. ## Source: ghsa-malware (40194d8b76beed1c302e92600d56ab077089dc5db4790851e20326587ebc7f3d) 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.

Affected software

npmghsa
chai-as-synced
Affected versions
=6.0.3

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: 06/26/2026, 22:36:16 UTC

Technical Analysis

The 'chai-as-synced' package (version 6.0.3) is a malicious npm package designed to impersonate the legitimate 'chai-as-promised' package. Upon being required, it executes a detached, stdio-ignored Node.js child process running a script that decodes a base64-obfuscated URL and a secret key stored in a fake local environment object. It performs an HTTPS GET request to this URL, retrieves a 'cookie' field containing JavaScript code, and executes it using the Function constructor with require injected. This fetched code runs within the installer's Node process with full require access, allowing it to load and execute arbitrary modules. The use of obfuscation, detached child processes, and hidden stdio streams indicates a covert loader mechanism. The package's declared dependencies (sqlite3, request, axios) and keywords do not match its advertised functionality, further evidencing malicious intent.

Potential Impact

The malicious code executes within the Node.js process of the user installing or requiring the package, with full access to the require function. This enables arbitrary code execution, potentially allowing attackers to run any code, access sensitive data, or compromise the host system. The covert nature of the loader and obfuscation techniques make detection difficult. There are no known exploits in the wild reported yet.

Mitigation Recommendations

No official patch or remediation is currently available for this package. Users should avoid installing or using 'chai-as-synced' version 6.0.3. Verify package authenticity before installation, prefer official and well-maintained packages, and remove any instances of this malicious package from projects. Monitor dependency sources carefully to prevent supply chain compromise.

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

Threat ID: 6a3ef7c927e9c7971900024d

Added to database: 06/26/2026, 22:06:01 UTC

Last enriched: 06/26/2026, 22:36:16 UTC

Last updated: 09/13/2026, 10:55:29 UTC

Views: 93

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