Malicious code in chai-as-init (npm)
chai-as-init is a malicious npm package that when imported downloads a C2 dropper from https://api.npoint[.]io/c2e881b8bc0fe2121454 and executes it (similar to malware in to chai-await-test). --- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (86a5e85d8d41d2f731104422d3a8e4a73d02354250782e45389d28acc2332854) Package name impersonates chai-as-promised and ships a README copied from pino as cover. The exported middleware spawns a detached node child running lib/initializeCaller.js, which decodes a base64-encoded URL (https://ipcheck-hashed.vercel.app/api/auth/b4dadd6a26d820d08596) and POSTs the full process.env (`{...process.env }`) — including any AWS/GCP/CI/npm tokens — to that endpoint with header `x-secret-header: secret`. The HTTP response body is then passed to `new Function('require', response.data)` and invoked with `require`, giving the remote operator arbitrary code execution with full Node privileges on any host that imports the package and invokes the middleware. Combination of name impersonation, copied README cover, base64-obfuscated C2, bulk env exfiltration, and dynamic remote-code evaluation is the canonical supply-chain RCE shape. ## Source: ghsa-malware (c0ce99e61fda9a489c749cea51adcf66648c56d26ee18a7aa4f0100db30615f9) 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.
AI Analysis
Technical Summary
chai-as-init is a malicious npm package that impersonates chai-as-promised and uses a copied README from pino as a cover. Its exported middleware spawns a detached Node.js child process which decodes a base64-encoded URL and sends the full environment variables, including AWS, GCP, CI, and npm tokens, to a remote endpoint with a secret header. The response is dynamically evaluated as JavaScript code with full Node.js privileges, enabling arbitrary remote code execution. This supply-chain attack vector combines name impersonation, environment exfiltration, and dynamic remote code execution, representing a canonical supply-chain RCE threat. The affected versions are 1.4.5, 1.4.6, and 1.4.7.
Potential Impact
Any system that installs or runs chai-as-init versions 1.4.5, 1.4.6, or 1.4.7 is fully compromised. The attacker gains arbitrary code execution with full Node privileges and can exfiltrate sensitive environment variables, including cloud and CI tokens. This can lead to complete system takeover and further compromise of connected infrastructure. Removal of the package alone does not guarantee eradication of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is available. The package should be immediately removed from all systems. All secrets and keys exposed on compromised systems must be rotated from a secure, uncompromised environment. Due to the full compromise risk, affected hosts should be considered untrusted and undergo thorough investigation and remediation. Monitor for any signs of persistence or additional malware.
Malicious code in chai-as-init (npm)
Description
chai-as-init is a malicious npm package that when imported downloads a C2 dropper from https://api.npoint[.]io/c2e881b8bc0fe2121454 and executes it (similar to malware in to chai-await-test). --- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (86a5e85d8d41d2f731104422d3a8e4a73d02354250782e45389d28acc2332854) Package name impersonates chai-as-promised and ships a README copied from pino as cover. The exported middleware spawns a detached node child running lib/initializeCaller.js, which decodes a base64-encoded URL (https://ipcheck-hashed.vercel.app/api/auth/b4dadd6a26d820d08596) and POSTs the full process.env (`{...process.env }`) — including any AWS/GCP/CI/npm tokens — to that endpoint with header `x-secret-header: secret`. The HTTP response body is then passed to `new Function('require', response.data)` and invoked with `require`, giving the remote operator arbitrary code execution with full Node privileges on any host that imports the package and invokes the middleware. Combination of name impersonation, copied README cover, base64-obfuscated C2, bulk env exfiltration, and dynamic remote-code evaluation is the canonical supply-chain RCE shape. ## Source: ghsa-malware (c0ce99e61fda9a489c749cea51adcf66648c56d26ee18a7aa4f0100db30615f9) 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
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
Technical Analysis
chai-as-init is a malicious npm package that impersonates chai-as-promised and uses a copied README from pino as a cover. Its exported middleware spawns a detached Node.js child process which decodes a base64-encoded URL and sends the full environment variables, including AWS, GCP, CI, and npm tokens, to a remote endpoint with a secret header. The response is dynamically evaluated as JavaScript code with full Node.js privileges, enabling arbitrary remote code execution. This supply-chain attack vector combines name impersonation, environment exfiltration, and dynamic remote code execution, representing a canonical supply-chain RCE threat. The affected versions are 1.4.5, 1.4.6, and 1.4.7.
Potential Impact
Any system that installs or runs chai-as-init versions 1.4.5, 1.4.6, or 1.4.7 is fully compromised. The attacker gains arbitrary code execution with full Node privileges and can exfiltrate sensitive environment variables, including cloud and CI tokens. This can lead to complete system takeover and further compromise of connected infrastructure. Removal of the package alone does not guarantee eradication of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is available. The package should be immediately removed from all systems. All secrets and keys exposed on compromised systems must be rotated from a secure, uncompromised environment. Due to the full compromise risk, affected hosts should be considered untrusted and undergo thorough investigation and remediation. Monitor for any signs of persistence or additional malware.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-2891
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-7cq2-px9f-cq3g"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a4c342c27e9c797195fa5a2
Added to database: 07/06/2026, 23:03:08 UTC
Last enriched: 07/06/2026, 23:24:32 UTC
Last updated: 07/26/2026, 19:28:48 UTC
Views: 41
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.