mal-2026-6710
Vulnerability from ossf_malicious_packages
Published
2026-07-01 19:15
Modified
2026-07-02 11:10
Summary
Malicious code in vitest-agent (npm)
Details

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

Source: amazon-inspector (6e0165cbb3d6ed37a96889c4b016463706346e1c09413635c31ea1ceedde8774)

The package's postinstall script (node lib/utils/index.js) spawns a detached, stdio-suppressed Node child process that runs lib/utils/smtp-connection/index.js. That file fetches JavaScript from https://jsonkeeper.com/b/WDH3V via axios and executes the response with new Function("require", r.data.cookie)(require), running unpinned, mutable, non-publisher code on the installer's machine at npm install time. The package is named vitest-agent but its main and shipped source are a verbatim copy of nodemailer (author field Andris Reinman, description is an unrelated React copyright string), a name/identity mismatch consistent with a lure targeting vitest ecosystem users. Concealment signals reinforce the dropper: a ~256 KB LICENSE file sits adjacent to a 185-byte dropper index.js under lib/utils/smtp-connection/, and path names mirror legitimate nodemailer layout as cover. Because the harmful code path fires automatically from the postinstall lifecycle hook, installers are compromised without any explicit user action beyond installing the package.

Source: ghsa-malware (c760a9cc4fdf3746f5c3ea670a49bc3441556a64a1fe3c97314375d427d7f1d4)

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/utils/smtp-connection/index.js",
              "sha256": "27bc8017644a3295d5d410ca6c8159d666a2ed002103b49f3afbaee13d35f487",
              "tlsh": "89c0225633c8201e202210e2530e10107013c8324d46c45da2040afa14e1a860a22ea4"
            },
            {
              "path": "package.json",
              "sha256": "2c03e07e921ee3e9230194af7b49defa2bec962e60a0eb1ea42c7ff404e9f228",
              "tlsh": "d0416526cd678df3229926ed78685182b460d00fcc0ab85d774d138c8f8e99f3678a6d"
            }
          ],
          "package_integrity": [
            {
              "filename": "vitest-agent-1.0.6.tgz",
              "hashes": {
                "sha1": "7c050744bbac52370c19b54d339cedb43537c7ff",
                "sha512_sri": "sha512-rKLI+8GqzL9A9D/ZR8hjCdVfqYjL5BiDpV1DbO32vHnDNK7zwHv0645d8B3GEmdox3C5MGDEdkSZU/GwaJHnmg=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "vitest-agent"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": [
        "1.0.6",
        "1.0.5"
      ]
    }
  ],
  "aliases": [
    "GHSA-w2r4-4x6j-3h5x"
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "IN-MAL-2026-007874",
        "import_time": "2026-07-01T20:12:12.361263503Z",
        "modified_time": "2026-07-01T19:16:03Z",
        "sha256": "6e0165cbb3d6ed37a96889c4b016463706346e1c09413635c31ea1ceedde8774",
        "source": "amazon-inspector",
        "versions": [
          "1.0.6"
        ]
      },
      {
        "id": "IN-MAL-2026-007873",
        "import_time": "2026-07-01T20:12:12.308262705Z",
        "modified_time": "2026-07-01T19:15:53Z",
        "sha256": "c3f7ebf642b562d3c33e78df9352951379038121536b34dc0a358e3dc5a6343e",
        "source": "amazon-inspector",
        "versions": [
          "1.0.5"
        ]
      },
      {
        "id": "GHSA-w2r4-4x6j-3h5x",
        "import_time": "2026-07-02T11:08:17.649278488Z",
        "modified_time": "2026-07-02T09:48:12Z",
        "ranges": [
          {
            "events": [
              {
                "introduced": "0"
              }
            ],
            "type": "SEMVER"
          }
        ],
        "sha256": "c760a9cc4fdf3746f5c3ea670a49bc3441556a64a1fe3c97314375d427d7f1d4",
        "source": "ghsa-malware"
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (6e0165cbb3d6ed37a96889c4b016463706346e1c09413635c31ea1ceedde8774)\nThe package\u0027s postinstall script (`node lib/utils/index.js`) spawns a detached, stdio-suppressed Node child process that runs `lib/utils/smtp-connection/index.js`. That file fetches JavaScript from `https://jsonkeeper.com/b/WDH3V` via axios and executes the response with `new Function(\"require\", r.data.cookie)(require)`, running unpinned, mutable, non-publisher code on the installer\u0027s machine at `npm install` time. The package is named `vitest-agent` but its `main` and shipped source are a verbatim copy of nodemailer (author field `Andris Reinman`, description is an unrelated React copyright string), a name/identity mismatch consistent with a lure targeting vitest ecosystem users. Concealment signals reinforce the dropper: a ~256 KB `LICENSE` file sits adjacent to a 185-byte dropper `index.js` under `lib/utils/smtp-connection/`, and path names mirror legitimate nodemailer layout as cover. Because the harmful code path fires automatically from the postinstall lifecycle hook, installers are compromised without any explicit user action beyond installing the package.\n\n## Source: ghsa-malware (c760a9cc4fdf3746f5c3ea670a49bc3441556a64a1fe3c97314375d427d7f1d4)\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-6710",
  "modified": "2026-07-02T11:10:03Z",
  "published": "2026-07-01T19:15:53Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/vitest-agent/v/1.0.6"
    },
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/vitest-agent/v/1.0.5"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-w2r4-4x6j-3h5x"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in vitest-agent (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…