CVE-2025-54313: eslint-config-prettier, eslint-plugin-prettier, synckit, @pkgr/core, napi-postinstall have embedded malicious code
7.5
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
eslint-config-prettier | npm | = 8.10.1 | 8.10.2 |
eslint-config-prettier | npm | = 9.1.1 | 9.1.2 |
eslint-config-prettier | npm | >= 10.1.6, <= 10.1.7 | 10.1.8 |
eslint-plugin-prettier | npm | >= 4.2.2, <= 4.2.3 | 4.2.4 |
synckit | npm | = 0.11.9 | 0.11.10 |
@pkgr/core | npm | = 0.2.8 | 0.2.9 |
napi-postinstall | npm | = 0.3.1 | 0.3.2 |
got-fetch | npm | >= 5.1.11, <= 5.1.12 | 6.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is a result of a supply chain attack where several popular npm packages were compromised and republished with malicious code. The attackers gained access to the npm accounts of the package maintainers and published new versions containing a malicious install.js
script. This script was configured to run automatically after the package is installed via the postinstall
hook in package.json
.
The install.js
script contains two primary functions: install
and download
. The install
function acts as the entry point. It first checks if the host operating system is Windows. If it is, it proceeds to call the download
function. The download
function then fetches a malicious DLL file (node-gyp.dll
) from a remote server and saves it to the local filesystem. Finally, the install
function executes the downloaded DLL, completing the infection.
The provided git commits only show the patches, which consist of version bumps to non-malicious versions. The malicious code itself was never committed to the git repositories, a common tactic in supply chain attacks to evade detection. The identification of the vulnerable functions is based on the analysis of the malicious install.js
script, as documented in the security blogs linked in the vulnerability details.
Vulnerable functions
install
install.js
download
install.js