Supply chain · npm · High
Critical Malicious Package 'chai-as-relay' in npm Poses Supply-Chain Risk
Threat Engine Auto-Feed · data current as of 2026-09-26
The npm package 'chai-as-relay' version 1.2.1 contains highly obfuscated, self-executing malicious code that runs upon import. This package impersonates a legitimate logger project, providing attackers with arbitrary code execution on systems that install and import it.
- Package: npm / chai-as-relay
- Affected versions: = 1.2.1
- Severity: critical
- Reach: unknown
- Exposure: 65/100 (High)
What happened — Compromised maintainer / package
The npm package 'chai-as-relay' version 1.2.1 was published containing malicious code. This code is a heavily obfuscated, multi-megabyte JavaScript bundle that executes immediately when the package is imported. The package's advertised functionality and other files are copied from a legitimate project, serving as a cover for the malicious dropper.
How the attack works
This is a compromised package attack where a malicious version of a software component is introduced into a public registry. When developers or automated systems install and import the affected version, the embedded malicious code is executed. This grants the attacker arbitrary code execution within the context of the process that imported the package, potentially leading to further system compromise.
Who's exposed
Profiles most at risk
- Development teams using the npm ecosystem
- CI/CD pipelines that automatically pull and build dependencies
- Organizations with applications that directly or indirectly depend on 'chai-as-relay' version 1.2.1
Conditions that increase exposure
- Projects with unpinned dependencies that could resolve to the malicious version
- Build systems that do not use lockfiles (e.g., package-lock.json, yarn.lock)
- Internal package mirrors that have synchronized the malicious version
- Developers or systems that have explicitly installed 'chai-as-relay@1.2.1'
Blast-radius scenarios
- An attacker gains arbitrary code execution on developer workstations or build servers
- Compromise of CI/CD pipelines leading to further supply chain attacks
- Data exfiltration or deployment of additional malware on affected systems
- Disruption of development workflows and potential intellectual property theft
What to do (defensive)
Detect
- Scan dependency trees for 'chai-as-relay' version 1.2.1
- Monitor for unusual network connections or process activity originating from npm package installations
- Review package integrity and content for unexpected obfuscated code or large, unexplained files
Contain
- Immediately block 'chai-as-relay' version 1.2.1 from being installed or accessed from internal registries
- Isolate any systems identified as having installed the malicious package
- Suspend builds and deployments that may be pulling the affected dependency
Remediate
- Remove 'chai-as-relay' version 1.2.1 from all projects and systems
- Update package lockfiles to explicitly exclude the malicious version and pin to known good versions of all dependencies
- Conduct a thorough forensic analysis of any systems where the package was installed and imported to identify potential compromise
- Rotate credentials and API keys that may have been exposed on compromised systems
Frontier verdict — High
Prioritize immediate removal of 'chai-as-relay' version 1.2.1 due to critical arbitrary code execution risk upon package import.
Sources
For detection-engineering and awareness only · point-in-time · not security advice · sourced from the GitHub Advisory Database.