mal-2026-12004
Vulnerability from ossf_malicious_packages
Published
2026-08-04 23:56
Modified
2026-08-10 00:30
Summary
Malicious code in vitest-preview-pro (npm)
Details

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

Source: amazon-inspector (367fd88886da38fc8a88929cfb486d6031ee42d44499b5f7a2d47d4e91d5b075)

The package is published under a name suggesting a Vitest preview utility, but the shipped code is a rebranded copy of nodemailer with an added preinstall dropper. package.json declares preinstall: node lib/utils/index.js, which uses child_process.spawn(process.execPath, [lib/utils/smtp-connection/index.js], {detached:true, stdio:['ignore','ignore','ignore']}).unref() to launch a detached, fully silenced child that survives beyond npm install. The spawned file is obfuscated with a custom basE91 string-array decoder; the decoded top-level async IIFE calls globalThis.fetch against a URL on api.jsonbin.io/v3/, parses the JSON response, and passes the record.cookie field to new Function('require', body)(require), executing attacker-controlled JavaScript with full require access on the installer at install time. api.jsonbin.io is a public, mutable, anonymous JSON-hosting service, so the executed payload can change at any time. Adjacent to the loader, lib/utils/smtp-connection/LICENSE is a 262KB file whose contents are a hex-encoded ~131KB opaque binary blob rather than license text, colocated with the loader as a staged secondary payload. The advertised package purpose has no relationship to the shipped SMTP source, providing cover for the injected dropper.

Source: ghsa-malware (3b0064885ea23f15a06a6ad10a6d57a101499e6015da4d94d8c49cc481ae34f0)

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.
  • 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.

{
  "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"
          },
          {
            "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/utils/smtp-connection/index.js",
              "sha256": "a87db3e13de1d1d06dfefc156e1a745cbeea5c2d1866340196150fd2bfefda88",
              "tlsh": "864164ca99c23e5ce1dd64a5cd3d29277714c99768cc10d2c6f28b5478dc6d583ec518"
            },
            {
              "path": "lib/utils/index.js",
              "sha256": "9fb27c30f484650bb4a39f65a03fbccdc0b9b5f1cb84700ca73ee8893c66e06e",
              "tlsh": "dae0686a23533738a034cbc1da30ce3b258b8020b365a0e0f00c406a2bc72c406ea8da"
            },
            {
              "path": "lib/utils/smtp-connection/LICENSE",
              "sha256": "78922197a1b55502112c7dfe1c456b242bcace75b5d19213c191f666a1209e4b",
              "tlsh": "c744bfbc76047de6267f575bd997aded036626239acba4cd80647bc304b3371ee02809"
            },
            {
              "path": "package.json",
              "sha256": "cba5adda71f0b4ec111270f96960a31c447e912379185d082f78a09b77234ff1",
              "tlsh": "cb41b925cda78ce7229525ed6cac9183b560d54fcd06b80db34c524c4f8e95f317866d"
            }
          ],
          "package_integrity": [
            {
              "filename": "vitest-preview-pro-10.0.3.tgz",
              "hashes": {
                "sha1": "b91f0103a110a40ea23ba9150eb80acf63bda516",
                "sha512_sri": "sha512-e+kxvvJpfgBQKrbOcX6p72OJ4o016GAMr2nr+Iy/DC63nlsnigXJ9A+VSP2pBFM3gbjVuDfQZY3quzVjGFaIvg=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "vitest-preview-pro"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": [
        "10.0.3",
        "10.0.7",
        "10.0.5",
        "10.0.6"
      ]
    }
  ],
  "aliases": [
    "GHSA-wx22-xm6j-mgqx"
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "IN-MAL-2026-011358",
        "import_time": "2026-08-05T00:04:38.603696929Z",
        "modified_time": "2026-08-04T23:56:52Z",
        "sha256": "367fd88886da38fc8a88929cfb486d6031ee42d44499b5f7a2d47d4e91d5b075",
        "source": "amazon-inspector",
        "versions": [
          "10.0.3"
        ]
      },
      {
        "id": "IN-MAL-2026-016873",
        "import_time": "2026-08-07T12:23:25.236362389Z",
        "modified_time": "2026-08-07T12:10:28Z",
        "sha256": "89c5df9061ae735cf633cb37fd2dacf7d296adcac7301ec30b469f85df81c953",
        "source": "amazon-inspector",
        "versions": [
          "10.0.7"
        ]
      },
      {
        "id": "IN-MAL-2026-017017",
        "import_time": "2026-08-07T12:51:22.367271191Z",
        "modified_time": "2026-08-07T12:31:44Z",
        "sha256": "232406b380ab6265da42e7031cf963ef260b438633ab80d232f0dae1e79f7a3c",
        "source": "amazon-inspector",
        "versions": [
          "10.0.5"
        ]
      },
      {
        "id": "IN-MAL-2026-017020",
        "import_time": "2026-08-07T12:51:22.486662022Z",
        "modified_time": "2026-08-07T12:32:10Z",
        "sha256": "a357f5333e94520bd0b1dec295d11b8058127be567534a43e63e8366fd47b838",
        "source": "amazon-inspector",
        "versions": [
          "10.0.6"
        ]
      },
      {
        "id": "GHSA-wx22-xm6j-mgqx",
        "import_time": "2026-08-09T23:21:54.578248Z",
        "modified_time": "2026-08-07T17:25:45Z",
        "ranges": [
          {
            "events": [
              {
                "introduced": "0"
              }
            ],
            "type": "SEMVER"
          }
        ],
        "sha256": "3b0064885ea23f15a06a6ad10a6d57a101499e6015da4d94d8c49cc481ae34f0",
        "source": "ghsa-malware"
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (367fd88886da38fc8a88929cfb486d6031ee42d44499b5f7a2d47d4e91d5b075)\nThe package is published under a name suggesting a Vitest preview utility, but the shipped code is a rebranded copy of nodemailer with an added preinstall dropper. package.json declares `preinstall: node lib/utils/index.js`, which uses child_process.spawn(process.execPath, [lib/utils/smtp-connection/index.js], {detached:true, stdio:[\u0027ignore\u0027,\u0027ignore\u0027,\u0027ignore\u0027]}).unref() to launch a detached, fully silenced child that survives beyond `npm install`. The spawned file is obfuscated with a custom basE91 string-array decoder; the decoded top-level async IIFE calls globalThis.fetch against a URL on api.jsonbin.io/v3/, parses the JSON response, and passes the `record.cookie` field to new Function(\u0027require\u0027, body)(require), executing attacker-controlled JavaScript with full `require` access on the installer at install time. api.jsonbin.io is a public, mutable, anonymous JSON-hosting service, so the executed payload can change at any time. Adjacent to the loader, lib/utils/smtp-connection/LICENSE is a 262KB file whose contents are a hex-encoded ~131KB opaque binary blob rather than license text, colocated with the loader as a staged secondary payload. The advertised package purpose has no relationship to the shipped SMTP source, providing cover for the injected dropper.\n\n## Source: ghsa-malware (3b0064885ea23f15a06a6ad10a6d57a101499e6015da4d94d8c49cc481ae34f0)\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-12004",
  "modified": "2026-08-10T00:30:54.733960479Z",
  "published": "2026-08-04T23:56:52Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/vitest-preview-pro/v/10.0.3"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/vitest-preview-pro/v/10.0.7"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/vitest-preview-pro/v/10.0.5"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/vitest-preview-pro/v/10.0.6"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-wx22-xm6j-mgqx"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in vitest-preview-pro (npm)"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

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…

Loading…