mal-2026-6532
Vulnerability from ossf_malicious_packages
Published
2026-06-26 17:44
Modified
2026-06-30 16:09
Summary
Malicious code in chai-as-assured (npm)
Details

-= Per source details. Do not edit below this line.=-

Source: amazon-inspector (bd28efd7a3d07f87ec22556cc25a8c07117fa4cdd237c6cb1db750c976a11836)

chai-as-assured impersonates the popular chai-as-promised package (matching README, author, and API surface). When the exported plugin function is invoked under normal usage, an async IIFE in the plugin body base64-decodes a hardcoded URL (https://amethyst-lorrin-26.tiiny.site/index.json), performs an axios.get against that anonymous third-party host with a disguised header, and executes the response's cookie field as JavaScript via new Function.constructor('require', response)(require). The fetched payload runs with full Node module privileges (filesystem, network, child_process, etc.) because require is passed in. The C2 URL, header name (x-secret-key), and header value are concealed as base64 strings inside a fake local process.env object (DEV_API_KEY / DEV_SECRET_KEY / DEV_SECRET_VALUE) that shadows Node's global to evade casual source review. The combination of name-confusion against a top-100 chai ecosystem package, deliberate obfuscation of attacker infrastructure, an unpinned anonymous tiiny.site host, and dynamic execution of the fetched response with require is an unambiguous remote-code-execution dropper targeting any project that installs and loads this plugin.

Source: ghsa-malware (c485746666d65194fcec1929637bee2ef3f7f7c1a427a5e28eaf2ce162ea8c19)

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 from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

CWE
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
  • CWE-506 - The product contains code that appears to be malicious in nature.
Credits

{
  "affected": [
    {
      "database_specific": {
        "cwes": [
          {
            "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"
          }
        ],
        "indicators": {
          "evidence_files": [
            {
              "path": "lib/chai-as-assured.js",
              "sha256": "8542f10efc33eda79dc2aa79214715e47e67c91dc5479da03d115ded42748398",
              "tlsh": "796244145aa369224477b37d734f5401f2358f279428ee90bbbc83592f0592cd693bf9"
            }
          ],
          "package_integrity": [
            {
              "filename": "chai-as-assured-7.1.2.tgz",
              "hashes": {
                "sha1": "216d3e7b2d2b06ba5833b65d62803f755abdc3a1",
                "sha512_sri": "sha512-ZBolKUYymMoNnP7tTQ6t15licpLaElg2+C7vPg3CQ4LD69v7GmROxD9TEb/TS7hScMzqM1hN8ZuFcN2sxLIOmA=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "chai-as-assured"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": [
        "7.1.2",
        "6.0.4"
      ]
    }
  ],
  "aliases": [
    "GHSA-m282-3m8c-qjwj"
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "IN-MAL-2026-007649",
        "import_time": "2026-06-26T18:42:49.597668653Z",
        "modified_time": "2026-06-26T17:44:23Z",
        "sha256": "bd28efd7a3d07f87ec22556cc25a8c07117fa4cdd237c6cb1db750c976a11836",
        "source": "amazon-inspector",
        "versions": [
          "7.1.2"
        ]
      },
      {
        "id": "IN-MAL-2026-007707",
        "import_time": "2026-06-29T05:07:04.861914641Z",
        "modified_time": "2026-06-29T03:21:08Z",
        "ranges": [
          {
            "events": [
              {
                "introduced": "0"
              }
            ],
            "type": "SEMVER"
          }
        ],
        "sha256": "abca3307a25c5cc8fcf8d53500c5227dff24ba0e3f534148735c7382f344d4ca",
        "source": "amazon-inspector",
        "versions": [
          "6.0.4"
        ]
      },
      {
        "id": "GHSA-m282-3m8c-qjwj",
        "import_time": "2026-06-30T16:08:01.477330524Z",
        "modified_time": "2026-06-30T15:56:12Z",
        "ranges": [
          {
            "events": [
              {
                "introduced": "0"
              }
            ],
            "type": "SEMVER"
          }
        ],
        "sha256": "c485746666d65194fcec1929637bee2ef3f7f7c1a427a5e28eaf2ce162ea8c19",
        "source": "ghsa-malware"
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (bd28efd7a3d07f87ec22556cc25a8c07117fa4cdd237c6cb1db750c976a11836)\nchai-as-assured impersonates the popular chai-as-promised package (matching README, author, and API surface). When the exported plugin function is invoked under normal usage, an async IIFE in the plugin body base64-decodes a hardcoded URL (https://amethyst-lorrin-26.tiiny.site/index.json), performs an axios.get against that anonymous third-party host with a disguised header, and executes the response\u0027s `cookie` field as JavaScript via `new Function.constructor(\u0027require\u0027, response)(require)`. The fetched payload runs with full Node module privileges (filesystem, network, child_process, etc.) because `require` is passed in. The C2 URL, header name (`x-secret-key`), and header value are concealed as base64 strings inside a fake local `process.env` object (DEV_API_KEY / DEV_SECRET_KEY / DEV_SECRET_VALUE) that shadows Node\u0027s global to evade casual source review. The combination of name-confusion against a top-100 chai ecosystem package, deliberate obfuscation of attacker infrastructure, an unpinned anonymous tiiny.site host, and dynamic execution of the fetched response with `require` is an unambiguous remote-code-execution dropper targeting any project that installs and loads this plugin.\n\n## Source: ghsa-malware (c485746666d65194fcec1929637bee2ef3f7f7c1a427a5e28eaf2ce162ea8c19)\nAny 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 from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.\n",
  "id": "MAL-2026-6532",
  "modified": "2026-06-30T16:09:50Z",
  "published": "2026-06-26T17:44:23Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/chai-as-assured/v/7.1.2"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/chai-as-assured/v/6.0.4"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-m282-3m8c-qjwj"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in chai-as-assured (npm)"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…