Skip to content
Heist/ feed
Unrated

Malicious code in chai-as-rendered (npm)

Type: advisorySource: OSV1 source record

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (545ba2341881e666831e81156a815fdfac738830ec2918167e4c5fd3c42294bf) Typosquat of chai-as-promised. The package's exported middleware spawns a detached child process (lib/caller.js) that fetches a JSON payload from a base64-obfuscated jsonstorage.net URL (https://api.jsonstorage.net/v1/json/2ef8c758-a96f-459e-b036-b3b90379a165/f89e8264-86c2-4684-94da-c3f82d59370f) and evaluates the returned.cookie string via new Function.constructor("require", s)(require), giving the fetched code full require access on the installer's host. The remote URL and request headers are stored as base64 strings under fake process.env names (DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE) and decoded with atob() at runtime to conceal the destination. The package name and keywords (fast, logger, stream, json) impersonate pino while the package name typosquats chai-as-promised.

Announced Group revision 1
Original source ↗

MAL-2026-12348

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:MAL-2026-12348

chai-as-rendered

Source reference: /affected/0/package/name

Affected versions
1.2.0

Source reference: /affected/0/versions

Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "package": {
      "name": "chai-as-rendered",
      "purl": "pkg:npm/chai-as-rendered",
      "ecosystem": "npm"
    },
    "versions": [
      "1.2.0"
    ],
    "database_specific": {
      "cwes": [
        {
          "name": "Embedded Malicious Code",
          "cweId": "CWE-506",
          "description": "The product contains code that appears to be malicious in nature."
        }
      ],
      "source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-rendered/MAL-2026-12348.json",
      "indicators": {
        "evidence_files": [
          {
            "path": "lib/caller.js",
            "tlsh": "6e01efd934fd501c021111ea171fa032a010e4373882d6c8374cc7428fa66bd2e93aef",
            "sha256": "ffa61701ff61ebc0c6d64cf09f5bc37a74a91b03b716129b90271d758dc164b7"
          },
          {
            "path": "package.json",
            "tlsh": "0701c061ce749e7304dd21824c2a0643b6614c435528fd2933d7513d0f9d9bf01bf21d",
            "sha256": "dfe14ad52936fd66e0d9f597459091f41a9f3ba899010bbde7a22f212bc6cd9b"
          }
        ],
        "package_integrity": [
          {
            "hashes": {
              "sha1": "9cb07e3ac4d77c8af3ce61f3887de233b0a42103",
              "sha512_sri": "sha512-86s/uZXVv0i1Z2Ty1Uu2eR8ESjvwzF6ixTrhTBAsCDjkYH1Rc88L2tZfmsZvg6pZHuenOgg6GmsXdwKJIEZqqA=="
            },
            "filename": "chai-as-rendered-1.2.0.tgz"
          }
        ]
      }
    }
  }
]

Publisher severity

No explicit severity was provided.

Event
#10957 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement