{"id":"MAL-2026-6705","revision":null,"records":[{"revision":"f91b6ebb189d475a957272ea0221c506","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"MAL-2026-6705","aliases":["GHSA-rgq3-mp7r-3cq5"],"title":"Malicious code in hardhat-compile-ethers (npm)","description":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (3bb9781577ff17698d2cb66a6cd832fe8bdda014b30c0c662055a45d42801ac1)\nThe package's main entry dist/src/index.js contains a payload appended after the legitimate Hardhat exports. On require/import (e.g. when Hardhat loads the user's config), it spawns a detached Node child (`spawn(process.execPath, ['-e', code], {detached:true, stdio:'ignore', windowsHide:true})`) that runs a base64-decoded command to silently `npm install driftpin --no-save --silent --no-audit --no-fund`, then `require('driftpin')` and invoke `getPlugin()()`, executing attacker-controlled code in the installer's Node process. Both the shell command and the module name 'driftpin' are base64-encoded to hide them from casual inspection, and the spawn options (detached, stdio ignored, windows window hidden) are evasion mechanics. The payload is absent from the TypeScript source (src/index.ts) and only appears in the published dist artifact, indicating post-build injection. The package name mimics legitimate Hardhat/ethers plugins (e.g. @nomicfoundation/hardhat-ethers, hardhat-deploy-ethers) and the README is copied from wighawag/hardhat-deploy, making this a typosquat that delivers a dependency-chain dropper. Installers are typically Hardhat development machines that hold wallet keys and signing material, making arbitrary code execution on import especially damaging.\n\n## Source: ghsa-malware (c22fdfc4d4e6583aa5a30fb32890d03ffe133e3cfb889deb1adf2d06156e938f)\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","state":0,"publishedAt":"2026-07-01T18:41:35+00:00","modifiedAt":"2026-07-27T10:08:31.8940343+00:00","affected":[{"ecosystem":"npm","name":"hardhat-compile-ethers","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":["0.4.7","0.4.10","0.4.12","0.4.11","0.4.8","0.4.6","0.4.5","0.4.4","0.4.2","0.4.0","0.4.3","0.0.1","0.4.9"],"rawVersionEvidence":null}],"metrics":[],"references":["https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.7","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.10","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.12","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.11","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.8","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.6","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.5","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.4","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.2","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.0","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.3","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.0.1","https://www.npmjs.com/package/hardhat-compile-ethers/v/0.4.9","https://github.com/advisories/GHSA-rgq3-mp7r-3cq5"],"sourceUrl":"https://osv.dev/vulnerability/MAL-2026-6705","license":"OSV · upstream source license applies","key":"osv:MAL-2026-6705","identifiers":["MAL-2026-6705","GHSA-rgq3-mp7r-3cq5"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-24T01:35:04.8725245+00:00","complete":true,"records":1792,"lastAttemptAt":"2026-11-24T01:35:04.8725245+00:00","lastSuccessAt":"2026-11-24T01:35:05.0385464+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:05.0385465+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-f6e4a7f93ed9acd6fcb1f804a4567f7b9b16730ac126110af8d6d24176317946-8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85","complete":true,"records":430969,"lastAttemptAt":"2026-11-24T01:35:03.7450335+00:00","lastSuccessAt":"2026-11-24T01:35:03.7398709+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:03.7450335+00:00","snapshotPublishedAt":"2026-11-24T00:38:02+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-f35dec9c892d4a34962744cc8a94da25","complete":false,"records":13935,"lastAttemptAt":"2026-11-24T01:45:02.9157773+00:00","lastSuccessAt":"2026-11-24T01:45:01.889+00:00","error":"456 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-24T01:45:01.889+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13374,"expectedIdentifiers":13982,"failedIdentifiers":456},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-24T01:35:04.8725245+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-24T01:35:04.8725245+00:00","lastSuccessAt":"2026-11-24T01:35:05.0393131+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:05.0393132+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-8c33077d0c904a2e95d5c5fe37c4221a","complete":true,"records":13947,"lastAttemptAt":"2026-11-24T01:35:25.5402562+00:00","lastSuccessAt":"2026-11-24T01:35:25.536+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:25.536+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13982,"expectedIdentifiers":13982,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-c86437892ddabdeaf17409463a17578b1e71dd185d64061100dd57629858f6d6","complete":true,"records":10074,"lastAttemptAt":"2026-11-24T01:35:04.3764802+00:00","lastSuccessAt":"2026-11-23T22:27:19.6557603+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:04.3764802+00:00","snapshotPublishedAt":"2026-11-23T21:33:52+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-24T01:35:03.8804046+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:03.8804046+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-15e801f03affdaac7ba10268556f4d0b3e1b9f897dae85fdcade5fc30d25011c","complete":true,"records":3217,"lastAttemptAt":"2026-11-24T01:35:04.7835805+00:00","lastSuccessAt":"2026-11-23T17:27:41.2539213+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:04.7835805+00:00","snapshotPublishedAt":"2026-11-23T16:18:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-c41399423d276dca4b043be850730e8108fe6ab724d5bef1a99daeb4f8074e30","complete":true,"records":232938,"lastAttemptAt":"2026-11-24T01:35:04.2718053+00:00","lastSuccessAt":"2026-11-24T00:27:03.6308807+00:00","error":null,"lastVerifiedAt":"2026-11-24T01:35:04.2718053+00:00","snapshotPublishedAt":"2026-11-23T23:48:45+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}