Malicious code in @testrelic/playwright-analytics (npm)
Description
The npm package @testrelic/playwright-analytics version 2.13.0 contains malicious code embedded in its postinstall script. This script uses obfuscation techniques including whitespace padding and a custom shuffle to hide a payload that dynamically executes arbitrary code. The payload gains access to Node.js built-ins by assigning key globals to the global object, enabling potentially harmful operations. Additional bundled files in the package invoke child processes and make outbound HTTP POST requests, inconsistent with the package's declared purpose as a Playwright analytics reporter.
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 @testrelic/playwright-analytics npm package version 2.13.0 includes a postinstall lifecycle script (scripts/postinstall.cjs) that runs automatically upon installation. This script contains a large whitespace padding to conceal an obfuscated payload, which reconstructs and executes code dynamically using indirect invocation of the Function constructor to evade static detection. The payload assigns require, module, __dirname, and __filename to the global object, allowing it to load arbitrary Node.js built-in modules. The package's bundled files also require 'child_process' and perform outbound HTTP POST calls and ping commands, indicating potentially malicious behavior inconsistent with its stated functionality.
Potential Impact
Installation of this package version results in execution of obfuscated malicious code with the ability to run arbitrary Node.js commands and make outbound network connections. This can lead to unauthorized code execution, data exfiltration, or system compromise on any system where the package is installed.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should avoid installing version 2.13.0 of @testrelic/playwright-analytics. If already installed, remove the package and audit systems for unauthorized activity. Monitor vendor advisories for updates or fixes. Since this is not a cloud service, remediation depends on user action.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-15565
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a92f7d9acd9273b49e75a71
Added to database: 08/29/2026, 15:16:41 UTC
Last enriched: 09/09/2026, 21:38:24 UTC
Last updated: 10/01/2026, 22:26:56 UTC
Views: 28
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.