Malicious code in weight2loss (npm)
The npm package 'weight2loss' version 1.0.5 contains malicious code in a setup.js file referenced by a postinstall hook. This code, if executed, steals sensitive credentials from the installer environment, exfiltrates them to an attacker-controlled server and email, downloads and executes additional malicious scripts, establishes persistent remote access via a cron job, and deletes itself to evade detection. The postinstall hook is misconfigured and does not auto-run on install in this exact version, but the malicious payload is fully functional if manually invoked or if the manifest is corrected. The package's stated purpose does not align with its malicious behavior.
AI Analysis
Technical Summary
The 'weight2loss' npm package version 1.0.5 includes a malicious setup.js script referenced by a postinstall hook that is currently misdeclared and thus not automatically executed by npm. If executed, this script reads sensitive installer-side secrets from configuration files and environment variables, exfiltrates this data via HTTP POST requests to a hardcoded URL and by email using attacker credentials, downloads and runs additional malicious scripts for arbitrary code execution, installs a cron job for persistent remote command execution, and removes the setup.js file to hinder forensic analysis. The malicious behavior is unrelated to the package's declared fitness analytics functionality.
Potential Impact
If the malicious setup.js script is executed, attacker-controlled code can steal sensitive credentials including tokens and keys from the user's environment, exfiltrate environment variables, execute arbitrary commands via downloaded scripts, and maintain persistent remote access through a cron job. This compromises the confidentiality and integrity of the affected system and any connected services using the stolen credentials. However, in the current package version, the postinstall hook is misconfigured and does not auto-run, reducing immediate risk unless the script is manually invoked or the manifest is corrected.
Mitigation Recommendations
Currently, the malicious postinstall script is not automatically executed due to a misconfigured postinstall hook in package.json. Users should avoid manually invoking setup.js or modifying the manifest to enable its execution. Since no official patch or advisory is provided, users should avoid using version 1.0.5 of 'weight2loss' entirely. Monitor for updates or vendor advisories for remediation. Consider removing the package if already installed and scanning systems for signs of compromise related to the described behaviors.
Malicious code in weight2loss (npm)
Description
The npm package 'weight2loss' version 1.0.5 contains malicious code in a setup.js file referenced by a postinstall hook. This code, if executed, steals sensitive credentials from the installer environment, exfiltrates them to an attacker-controlled server and email, downloads and executes additional malicious scripts, establishes persistent remote access via a cron job, and deletes itself to evade detection. The postinstall hook is misconfigured and does not auto-run on install in this exact version, but the malicious payload is fully functional if manually invoked or if the manifest is corrected. The package's stated purpose does not align with its malicious behavior.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'weight2loss' npm package version 1.0.5 includes a malicious setup.js script referenced by a postinstall hook that is currently misdeclared and thus not automatically executed by npm. If executed, this script reads sensitive installer-side secrets from configuration files and environment variables, exfiltrates this data via HTTP POST requests to a hardcoded URL and by email using attacker credentials, downloads and runs additional malicious scripts for arbitrary code execution, installs a cron job for persistent remote command execution, and removes the setup.js file to hinder forensic analysis. The malicious behavior is unrelated to the package's declared fitness analytics functionality.
Potential Impact
If the malicious setup.js script is executed, attacker-controlled code can steal sensitive credentials including tokens and keys from the user's environment, exfiltrate environment variables, execute arbitrary commands via downloaded scripts, and maintain persistent remote access through a cron job. This compromises the confidentiality and integrity of the affected system and any connected services using the stolen credentials. However, in the current package version, the postinstall hook is misconfigured and does not auto-run, reducing immediate risk unless the script is manually invoked or the manifest is corrected.
Mitigation Recommendations
Currently, the malicious postinstall script is not automatically executed due to a misconfigured postinstall hook in package.json. Users should avoid manually invoking setup.js or modifying the manifest to enable its execution. Since no official patch or advisory is provided, users should avoid using version 1.0.5 of 'weight2loss' entirely. Monitor for updates or vendor advisories for remediation. Consider removing the package if already installed and scanning systems for signs of compromise related to the described behaviors.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13485
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a7573b5bf8831d539d93aa5
Added to database: 08/07/2026, 05:57:09 UTC
Last enriched: 08/07/2026, 07:43:44 UTC
Last updated: 08/07/2026, 07:43:44 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.