Skip to content
supplychainattack.orgSupply chain attack incident catalog
containedcritical

Malicious code in weight2loss (npm)

The npm package weight2loss contains malicious code in setup.js that steals credentials, exfiltrates environment variables, executes arbitrary code, and establishes persistent remote access. The postinstall hook is misconfigured in the current version, preventing automatic execution on install, but the payload is functional if invoked.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any developer or system that installs the weight2loss npm package and executes setup.js, or requires it in code.
Ecosystems
Attack vectors
Affected entities
  • weight2lossnpm package containing malicious setup.js

The npm package weight2loss was found to contain a malicious setup.js file that performs credential theft, data exfiltration, and remote code execution. The script reads sensitive files and environment variables including ~/.npmrc, ~/.ssh/, ~/.gitconfig, ~/.aws/, and credential-shaped environment variables (GITHUB_TOKEN, AWS_SECRET_ACCESS_KEY, etc.), then exfiltrates this data along with a base64-encoded copy of process.env to https://news.reimbursor.info via POST requests and email through smtp.gmail.com using hardcoded attacker credentials.\n\nThe malicious payload also downloads and executes arbitrary shell scripts from http://attacker.com/miner.sh and http://attacker.com/backdoor.sh, and establishes persistence by installing an hourly crontab entry that fetches and executes http://attacker.com/check. After execution, the script deletes itself to reduce forensic traces.\n\nThe postinstall hook is currently declared as a top-level package.json field rather than under the scripts section, which prevents npm from automatically invoking it during installation in this version. However, the full stealer/dropper/backdoor payload is present and functional if setup.js is explicitly required or invoked, or if the manifest is corrected.\n\nThe package's declared purpose of fitness analytics does not match any of the observed malicious behavior. The incident was identified by the OpenSSF malicious-packages project.

Indicators of compromise

Packages
  • weight2loss
Domains
  • news.reimbursor.info
  • attacker.com
  • smtp.gmail.com

Remediation

  • Immediately uninstall the weight2loss package from all systems
  • Audit npm audit logs and package-lock.json for any installation of weight2loss
  • Rotate all credentials that may have been exposed (AWS keys, GitHub tokens, SSH keys, git config credentials)
  • Review ~/.npmrc, ~/.ssh, ~/.gitconfig, and ~/.aws directories for unauthorized access or modifications
  • Check for unauthorized cron jobs, particularly hourly entries that may execute remote scripts
  • Monitor systems for outbound connections to news.reimbursor.info, attacker.com, and smtp.gmail.com
  • Review process.env logs for exfiltration of sensitive environment variables
  • Use npm audit to check for any other malicious packages in the dependency tree

Sources

  1. GitHub Advisory GHSA-8hq6-jx73-fgjw · GitHub Advisory Database

Cite this entry

"Malicious code in weight2loss (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 7, 2026; last updated August 7, 2026. https://supplychainattack.org/incident/malicious-code-in-weight2loss-npm-xi8yjk

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. resolvedcritical

    Malicious code in epic-common-node (npm)

    The npm package epic-common-node was found to contain malicious code. The package has been identified and reported through GitHub Security Advisory GHSA-m36g-mhjr-ww2c.

    npmCompromised package
  2. containedcritical

    Malicious code in epic-common (npm)

    The npm package epic-common was found to contain malicious code. The package was identified by Amazon Inspector and reported through the OpenSSF malicious packages database.

    npmCompromised package
  3. containedcritical

    Malware in leb128x

    The npm package leb128x was found to contain malware that grants full system compromise to attackers. Any computer with this package installed or running should be considered fully compromised and all secrets and keys rotated immediately from a different machine.

    npmCompromised package
  4. containedcritical

    Malicious code in checkout-desktop-total (npm)

    The npm package checkout-desktop-total contained malicious code that executes a hidden loader on import, downloading and running platform-specific native payloads from attacker-controlled Cloudflare Workers hosts or reconstructing them via DNS TXT records under wel1.ru. Any system that imported this package should be considered compromised.

    npmCompromised package