Skip to content
Heist/ feed
Unrated

Malicious code in chai-as-reddit (npm)

Type: advisorySource: OSV1 source record

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (8eff17b9d2536e662413c5c7090a1611f8c2813033a03960f9d979f23f2f72e7) The npm package chai-as-reddit@7.0.4 is a trojaned distribution. Its published metadata and README describe a Chai plugin for Reddit API assertions, but the shipped tree (lib/, docs/, docsify/, SECURITY.md, LICENSE, index.d.ts) is copied from the unrelated Pino logger project as camouflage. The real entry point index.js is an unrelated Express-style middleware factory that additionally runs `require('./lib/config')` at top level. lib/config.js is a ~4 MB heavily obfuscated JavaScript file using obfuscator.io-style transformations (hex-string identifiers, a ~23,890-entry rotating string array, control-flow flattening, encoded number/string wrappers), and it does not exist in genuine Pino. Because index.js loads it at module top level, the opaque payload executes in the installer's Node.js process on any require or import of the package, before any exported API is invoked. The combination of a cover-story package name and README, camouflage sourced from an unrelated project, and an auto-executed obfuscated blob is characteristic of a supply-chain execution payload. ## Source: ghsa-malware (2001f9e400a8a00d732bdcdfc5b0744420a7595ec39311cda805ca53fce035ad) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately fro

Announced Group revision 1
Original source ↗

MAL-2026-10939

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-10939

chai-as-reddit

Source reference: /affected/0/package/name

Affected versions
7.0.2

Source reference: /affected/0/versions

7.0.4

Source reference: /affected/0/versions

7.0.3

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.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          }
        ]
      }
    ],
    "package": {
      "name": "chai-as-reddit",
      "purl": "pkg:npm/chai-as-reddit",
      "ecosystem": "npm"
    },
    "versions": [
      "7.0.2",
      "7.0.4",
      "7.0.3"
    ],
    "database_specific": {
      "cwes": [
        {
          "name": "Embedded Malicious Code",
          "cweId": "CWE-506",
          "description": "The product contains code that appears to be malicious in nature."
        },
        {
          "name": "Embedded Malicious Code",
          "cweId": "CWE-506",
          "description": "The product contains code that appears to be malicious in nature."
        },
        {
          "name": "Embedded Malicious Code",
          "cweId": "CWE-506",
          "description": "The product contains code that appears to be malicious in nature."
        },
        {
          "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-reddit/MAL-2026-10939.json",
      "indicators": {
        "evidence_files": [
          {
            "path": "index.js",
            "tlsh": "1e1123a168c650ce9834cad0b6306416bcdbc737320722b3b9fc57c927860081521fba",
            "sha256": "24a3ce33886e8c8b5728e9ec619647bbc4b29193b271ad5eb3d90a5be5a712a7"
          },
          {
            "path": "lib/config.js",
            "tlsh": "70f5b8487971e03783dd1767be4a1fece63a186694c8a52b8558bd9f39bc107c1a3ce0",
            "sha256": "1e3f9c43442ed0d25dcaa88833a12cf68ab3865c55031308fe4b5e8ec29c3a92"
          },
          {
            "path": "package.json",
            "tlsh": "7e110462c8355da30ae82590586a050ab2218a578d18bd1d73f3902d6f9d96f21bfd4d",
            "sha256": "9c4b08050cf1cbd19145f92006ab140bd247ffdb4f2f6d33f5b89866aaa88f2a"
          }
        ]
      }
    }
  }
]

Publisher severity

No explicit severity was provided.

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