{"id":"MAL-2025-49286","summary":"Malicious code in gunpowder-ghost (npm)","details":"Four pirate-themed npm packages (`blackbeards-navigator`, `beusy`, `sirens-lament`, `gunpowder-ghost`) were published by the npm account `beusy` with heavily inflated version numbers (209.0.0–210.0.0), a hallmark of dependency confusion attacks. Each package contains identical malicious lifecycle scripts (`preinstall`, `install`, and `postinstall`) that run on npm install, searching the entire filesystem (up to 8 directory levels deep) for HackTheBox CTF flags matching the pattern `HTB{`. If no flags are found, the scripts collect environment variables and `/proc/1/environ` as a fallback. The collected data is base64-encoded and exfiltrated via an HTTPS GET request to an attacker-controlled ngrok tunnel (`https://7f83-194-51-113-30.ngrok-free.app`), with the package name and hostname included as query parameters. The packages have no legitimate functionality; `index.js` exports an empty object.\n\nThis package (`gunpowder-ghost`) identifies itself as `pkg=gunpowder-ghost` in the exfil request. All three lifecycle hooks run the same payload, ensuring execution regardless of npm lifecycle ordering.\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (72ea86dd3432c899e1fac658c0474958798e1e953d4f01d8f487d692db5c07aa)\nThe package gunpowder-ghost was found to contain malicious code.\n\n## Source: ghsa-malware (25ba50bd0b006bb4ebc0372a331468ab321d9f2a3e0ae60eb600ffb233bec27e)\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\n## Source: ossf-package-analysis (70dc4997af7e9a6e5468ab528abef41f755038e72abee6fa9a59fcec98825e54)\nThe OpenSSF Package Analysis project identified 'gunpowder-ghost' @ 209.0.0 (npm) as malicious.\n\nIt is considered malicious because:\n\n- The package communicates with a domain associated with malicious activity.\n\n- The package executes one or more commands associated with malicious behavior.\n","aliases":["GHSA-894m-pqq3-rvq3"],"modified":"2026-05-01T09:05:09.992305Z","published":"2025-10-31T02:28:48Z","database_specific":{"malicious-packages-origins":[{"modified_time":"2025-10-31T02:28:48Z","sha256":"72ea86dd3432c899e1fac658c0474958798e1e953d4f01d8f487d692db5c07aa","import_time":"2025-10-31T02:36:39.906390333Z","source":"amazon-inspector","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]},{"modified_time":"2026-04-30T11:36:06Z","versions":["209.0.0"],"import_time":"2026-04-30T12:02:00.623671175Z","source":"ossf-package-analysis","sha256":"70dc4997af7e9a6e5468ab528abef41f755038e72abee6fa9a59fcec98825e54"},{"modified_time":"2026-04-30T13:55:42Z","versions":["217.0.0"],"import_time":"2026-04-30T14:17:25.527531379Z","source":"ossf-package-analysis","sha256":"e274143bddc9c3a0b09cb16361c6b8d75513111195dc10f724928d86bd73c465"},{"modified_time":"2026-04-30T13:41:30Z","versions":["213.0.0"],"import_time":"2026-04-30T14:17:25.118706528Z","source":"ossf-package-analysis","sha256":"311620640c541c78deada9bf6474201e6a623cbd6493c6f6d8b8fc465841401f"},{"modified_time":"2026-04-30T13:37:08Z","versions":["212.0.0"],"import_time":"2026-04-30T14:17:24.744833175Z","source":"ossf-package-analysis","sha256":"d04b9bee9c28d257e944d668162264c7e5e9a9aafcd2fe6f7f0af69f415efba2"},{"modified_time":"2026-04-30T13:07:10Z","versions":["211.0.0"],"import_time":"2026-04-30T14:17:24.416134781Z","source":"ossf-package-analysis","sha256":"dadaec47437240b161757a74f43005363f14f2451506737e621169386b0ccf14"},{"modified_time":"2026-04-30T14:30:35Z","versions":["225.0.0"],"import_time":"2026-04-30T15:17:00.91468869Z","source":"ossf-package-analysis","sha256":"ecf4509c8e143407eceed952e59b74270feb1b865f714928a7b93f2094e275d2"},{"modified_time":"2026-05-01T08:13:07Z","sha256":"25ba50bd0b006bb4ebc0372a331468ab321d9f2a3e0ae60eb600ffb233bec27e","import_time":"2026-05-01T08:55:09.016703015Z","id":"GHSA-894m-pqq3-rvq3","source":"ghsa-malware","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]}]},"references":[{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-894m-pqq3-rvq3"}],"affected":[{"package":{"name":"gunpowder-ghost","ecosystem":"npm","purl":"pkg:npm/gunpowder-ghost"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["209.0.0","217.0.0","213.0.0","212.0.0","211.0.0","225.0.0","210.0.0"],"database_specific":{"cwes":[{"cweId":"CWE-506","name":"Embedded Malicious Code","description":"The product contains code that appears to be malicious in nature."}],"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/gunpowder-ghost/MAL-2025-49286.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["actran@amazon.com"],"type":"FINDER"},{"name":"OpenSSF: Package Analysis","contact":["https://github.com/ossf/package-analysis","https://openssf.slack.com/channels/package_analysis"],"type":"FINDER"},{"name":"SafeDep","contact":["https://safedep.io"],"type":"FINDER"}]}