Malicious code in vite-plugin-cleaner (npm)
The npm package vite-plugin-cleaner version 4.1.3 includes an optional dependency on vite-cleaning-tools, which is fetched directly from a mutable GitHub repository reference without a fixed commit or tag. This causes the postinstall script to execute code from the latest GitHub HEAD on every npm install, allowing the repository maintainer or anyone with write access to inject arbitrary code at install time without publishing a new npm version.
AI Analysis
Technical Summary
The vulnerability arises because [email protected] declares an optionalDependency 'vite-cleaning-tools' pointing to 'github:vite-plugins/vite-cleaning-tools' without a fixed commit SHA or tag. During installation, npm fetches the current HEAD of this GitHub repository and runs its code via a postinstall script that executes 'require("vite-cleaning-tools")' inside a try/catch block. This design allows dynamic code execution from an external mutable source outside the npm registry, enabling potential injection of malicious code by the repository maintainer or any actor who gains write access to the GitHub repository. Since the payload is fetched dynamically, npm registry scanning does not detect this malicious code.
Potential Impact
This vulnerability allows arbitrary code execution on machines installing [email protected] due to the dynamic fetching and execution of code from an external GitHub repository. The attacker can modify the repository to run malicious code during npm install without needing to publish a new version to the npm registry. This can lead to compromise of developer environments or CI/CD pipelines that install this package.
Mitigation Recommendations
No official patch or fix is currently documented. Users should avoid installing vite-plugin-cleaner version 4.1.3 or any versions that rely on mutable GitHub references for dependencies. Pinning dependencies to fixed commit SHAs or tags is recommended to prevent dynamic code execution. Monitor the vendor or repository for any official advisories or updates addressing this issue. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
Malicious code in vite-plugin-cleaner (npm)
Description
The npm package vite-plugin-cleaner version 4.1.3 includes an optional dependency on vite-cleaning-tools, which is fetched directly from a mutable GitHub repository reference without a fixed commit or tag. This causes the postinstall script to execute code from the latest GitHub HEAD on every npm install, allowing the repository maintainer or anyone with write access to inject arbitrary code at install time without publishing a new npm version.
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 vulnerability arises because [email protected] declares an optionalDependency 'vite-cleaning-tools' pointing to 'github:vite-plugins/vite-cleaning-tools' without a fixed commit SHA or tag. During installation, npm fetches the current HEAD of this GitHub repository and runs its code via a postinstall script that executes 'require("vite-cleaning-tools")' inside a try/catch block. This design allows dynamic code execution from an external mutable source outside the npm registry, enabling potential injection of malicious code by the repository maintainer or any actor who gains write access to the GitHub repository. Since the payload is fetched dynamically, npm registry scanning does not detect this malicious code.
Potential Impact
This vulnerability allows arbitrary code execution on machines installing [email protected] due to the dynamic fetching and execution of code from an external GitHub repository. The attacker can modify the repository to run malicious code during npm install without needing to publish a new version to the npm registry. This can lead to compromise of developer environments or CI/CD pipelines that install this package.
Mitigation Recommendations
No official patch or fix is currently documented. Users should avoid installing vite-plugin-cleaner version 4.1.3 or any versions that rely on mutable GitHub references for dependencies. Pinning dependencies to fixed commit SHAs or tags is recommended to prevent dynamic code execution. Monitor the vendor or repository for any official advisories or updates addressing this issue. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13463
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a75744bbf8831d539d9af05
Added to database: 08/07/2026, 05:59:39 UTC
Last enriched: 08/07/2026, 06:13:10 UTC
Last updated: 08/07/2026, 18:13:36 UTC
Views: 7
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.