MAL-2026-17233
Vulnerability from ossf_malicious_packages
Published
2026-09-28 22:06
Modified
2026-09-28 22:06
Summary
Malicious code in hardhat-lock (npm)
Details

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

Source: amazon-inspector (035a099bd6a60e41f1e1cbc1b70f27fecb9bef3f12d54e016d6991b581fc880f)

The npm package hardhat-lock@2.21.0 publishes itself as a logger/middleware but its identity and contents are inconsistent with that purpose: README badges, LICENSE, index.d.ts and docs/* are copied from the unrelated pino project (maintained by pinojs), while the package name squats the Ethereum-tooling keyword 'hardhat'. index.js unconditionally executes require('./lib/config') at module load, and lib/config.js is a ~4MB obfuscator.io-style single-line file (rotated string array of 23,981 entries, hex-escaped tokens, numeric wrapper decoders mt/mw/M0..M5/K/R/s/G, control-flow flattening, and 40,131 inline decoder replacements confirmed by webcrack) whose top-level IIFE runs the moment any downstream code does require('hardhat-lock'). The combination — impersonation of an established package under a different scope-adjacent name, opaque multi-megabyte obfuscated blob with no plausible logging use, and guaranteed import-time execution — is a supply-chain payload carrier: installing and loading the package places attacker-controlled code inside the consumer's Node.js process with unrestricted access to environment variables, filesystem, and network.

CWE
  • 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"
          }
        ],
        "indicators": {
          "evidence_files": [
            {
              "path": "lib/config.js",
              "sha256": "3a7f87ca7f738984bd7918a88da35a9898a491fd969e4ff43e619b25f2394abb",
              "tlsh": "f0168345b287bc2742cf2663be0139ec7467656284c8a18bcb56bd1d35bc80bd9e6fd0"
            },
            {
              "path": "package.json",
              "sha256": "41f964a7bcd40ce7bba7db5637bf1b8042f369f6f593d5fffac7444da14025d7",
              "tlsh": "58017620deb88e2301ed25524c2a0643b6618c175528fc2932dba12c4f9d5ff11bf22d"
            }
          ],
          "package_integrity": [
            {
              "filename": "hardhat-lock-2.21.0.tgz",
              "hashes": {
                "sha1": "b036b5f9842b331a904a85fbe25837250f4b98b7",
                "sha512_sri": "sha512-ttehUm7EVQpEfmbHPky/yKcqxlZCqW754j8GJA4b8cTesVq+1qkaUy0i5ESIJGhs/vk9cchNrfWad9hcLykTDg=="
              }
            }
          ]
        }
      },
      "package": {
        "ecosystem": "npm",
        "name": "hardhat-lock"
      },
      "versions": [
        "2.21.0"
      ]
    }
  ],
  "credits": [
    {
      "contact": [
        "inspector-research@amazon.com"
      ],
      "name": "Amazon Inspector",
      "type": "FINDER"
    }
  ],
  "database_specific": {
    "malicious-packages-origins": [
      {
        "id": "IN-MAL-2026-020620",
        "import_time": "2026-09-28T22:18:23.506719528Z",
        "modified_time": "2026-09-28T22:06:53Z",
        "sha256": "035a099bd6a60e41f1e1cbc1b70f27fecb9bef3f12d54e016d6991b581fc880f",
        "source": "amazon-inspector",
        "versions": [
          "2.21.0"
        ]
      }
    ]
  },
  "details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (035a099bd6a60e41f1e1cbc1b70f27fecb9bef3f12d54e016d6991b581fc880f)\nThe npm package hardhat-lock@2.21.0 publishes itself as a logger/middleware but its identity and contents are inconsistent with that purpose: README badges, LICENSE, index.d.ts and docs/* are copied from the unrelated pino project (maintained by pinojs), while the package name squats the Ethereum-tooling keyword \u0027hardhat\u0027. index.js unconditionally executes require(\u0027./lib/config\u0027) at module load, and lib/config.js is a ~4MB obfuscator.io-style single-line file (rotated string array of 23,981 entries, hex-escaped tokens, numeric wrapper decoders mt/mw/M0..M5/K/R/s/G, control-flow flattening, and 40,131 inline decoder replacements confirmed by webcrack) whose top-level IIFE runs the moment any downstream code does require(\u0027hardhat-lock\u0027). The combination \u2014 impersonation of an established package under a different scope-adjacent name, opaque multi-megabyte obfuscated blob with no plausible logging use, and guaranteed import-time execution \u2014 is a supply-chain payload carrier: installing and loading the package places attacker-controlled code inside the consumer\u0027s Node.js process with unrestricted access to environment variables, filesystem, and network.\n",
  "id": "MAL-2026-17233",
  "modified": "2026-09-28T22:06:53Z",
  "published": "2026-09-28T22:06:53Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://www.npmjs.com/package/hardhat-lock/v/2.21.0"
    }
  ],
  "schema_version": "1.7.4",
  "summary": "Malicious code in hardhat-lock (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…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…