Malicious code in chai-as-auth (npm)
The npm package 'chai-as-auth' version 2.3.5 contains malicious code that exfiltrates environment variables to a remote server and executes arbitrary code received from that server. The package masquerades as a legitimate authentication library but includes a self-executing script that sends sensitive data such as AWS/GCP tokens, CI secrets, npm tokens, and database credentials to a hardcoded URL. The remote server response is executed with full Node.js require access, enabling further malicious payloads.
AI Analysis
Technical Summary
The 'chai-as-auth' npm package version 2.3.5 includes a self-invoking function in lib/initializeCaller.js that POSTs the entire process.env object to a base64-encoded remote endpoint (https://ipcheck-hashed.vercel.app/api/auth/6c1d60d35852ef0c05df). The response from this endpoint is executed as Node.js code with full require access, allowing arbitrary code execution. This behavior effectively leaks sensitive environment variables and grants the attacker the ability to run arbitrary code within the victim's environment. The package is a repackaged combination of a pino logging library and a stealer module, designed to appear as a legitimate authentication library while performing malicious actions.
Potential Impact
Sensitive environment variables, including cloud credentials, CI secrets, npm tokens, and database credentials, are exfiltrated to a remote server controlled by an attacker. The attacker can execute arbitrary Node.js code with full require access on the victim system, potentially leading to full system compromise, data theft, and further malicious activity within the environment where the package is used.
Mitigation Recommendations
No official patch or remediation is currently available for this malicious package version. Users should immediately remove 'chai-as-auth' version 2.3.5 from their projects and replace it with trusted, verified packages. Audit dependencies for this package and any other suspicious or untrusted modules. Rotate any potentially exposed credentials and secrets that may have been compromised due to this package. Monitor for unauthorized access or unusual activity related to leaked credentials.
Malicious code in chai-as-auth (npm)
Description
The npm package 'chai-as-auth' version 2.3.5 contains malicious code that exfiltrates environment variables to a remote server and executes arbitrary code received from that server. The package masquerades as a legitimate authentication library but includes a self-executing script that sends sensitive data such as AWS/GCP tokens, CI secrets, npm tokens, and database credentials to a hardcoded URL. The remote server response is executed with full Node.js require access, enabling further malicious payloads.
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
The 'chai-as-auth' npm package version 2.3.5 includes a self-invoking function in lib/initializeCaller.js that POSTs the entire process.env object to a base64-encoded remote endpoint (https://ipcheck-hashed.vercel.app/api/auth/6c1d60d35852ef0c05df). The response from this endpoint is executed as Node.js code with full require access, allowing arbitrary code execution. This behavior effectively leaks sensitive environment variables and grants the attacker the ability to run arbitrary code within the victim's environment. The package is a repackaged combination of a pino logging library and a stealer module, designed to appear as a legitimate authentication library while performing malicious actions.
Potential Impact
Sensitive environment variables, including cloud credentials, CI secrets, npm tokens, and database credentials, are exfiltrated to a remote server controlled by an attacker. The attacker can execute arbitrary Node.js code with full require access on the victim system, potentially leading to full system compromise, data theft, and further malicious activity within the environment where the package is used.
Mitigation Recommendations
No official patch or remediation is currently available for this malicious package version. Users should immediately remove 'chai-as-auth' version 2.3.5 from their projects and replace it with trusted, verified packages. Audit dependencies for this package and any other suspicious or untrusted modules. Rotate any potentially exposed credentials and secrets that may have been compromised due to this package. Monitor for unauthorized access or unusual activity related to leaked credentials.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10518
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a55ff7d68715ace432f3884
Added to database: 07/14/2026, 09:21:01 UTC
Last enriched: 07/14/2026, 09:40:17 UTC
Last updated: 07/30/2026, 05:43:38 UTC
Views: 42
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.
External Links
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.