Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in vite-svg-parse (npm)

The npm package vite-svg-parse contains malicious code that decodes base64 strings at runtime to install and execute an undeclared hidden dependency (node-internal-svg-loader) when the library's documented API is called. The attack conceals both the shell command and module name in base64 to evade static inspection.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any npm consumer importing vite-svg-parse and calling its documented API (getPlugin/setPlugin)
Ecosystems
Attack vectors
Affected entities
  • vite-svg-parse

The npm package vite-svg-parse was found to contain malicious code embedded in its exported API functions (getPlugin/setPlugin). When these documented functions are invoked by a consumer, the package decodes two base64-encoded strings at runtime.

The first decoded string becomes the shell command npm install node-internal-svg-loader --no-save --silent --no-audit --no-fund, which is executed via child_process.spawn. The second decoded string resolves to the module name node-internal-svg-loader, which is then dynamically required and its getPlugin()/setPlugin() functions are invoked.

The fetched package is not declared in vite-svg-parse's package.json dependencies, making it an undeclared hidden third-party dependency. Both the shell command and require target are concealed in base64 encoding to evade static code inspection and automated security scanning.

Any developer who imports vite-svg-parse and calls its documented API will unknowingly trigger installation and execution of arbitrary code from node-internal-svg-loader in their Node.js process.

Indicators of compromise

Packages
  • vite-svg-parse
  • node-internal-svg-loader

Remediation

  • Remove vite-svg-parse from all projects immediately
  • Audit npm install logs and node_modules for unexpected packages, particularly node-internal-svg-loader
  • Review and revoke any credentials or tokens that may have been exposed during the malicious code execution
  • Update to a safe alternative SVG parsing library for Vite
  • Implement npm package integrity checks and dependency scanning in CI/CD pipelines to detect undeclared dependencies

Sources

  1. GitHub Advisory GHSA-27vm-5h98-8xf6 · GitHub Advisory Database

Cite this entry

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

Suggest a correction

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

  1. containedcritical

    Malware in svelte-dim-kit

    The npm package svelte-dim-kit was found to contain malware, potentially giving attackers full control of affected systems. All systems with this package installed should be considered compromised and secrets/keys rotated immediately from a different computer.

    npmCompromised package
  2. containedcritical

    Malicious code in @syncraft-labs/react (npm)

    The npm package @syncraft-labs/react contained obfuscated malicious code in its ESM distribution that implements the EtherHiding pattern, fetching and executing arbitrary code from an Ethereum smart contract via RPC endpoints. The tampering occurred post-build in the dist/index.js artifact.

    npmCompromised package
  3. containedcritical

    Malicious code in stillm4ddpocs-demo-sprocket (npm)

    The npm package stillm4ddpocs-demo-sprocket version 999.9.12 contains malicious code that exfiltrates system and project metadata via multiple channels (HTTPS, HTTP, and DNS) to a hardcoded callback host. The package uses a high version number to exploit dependency-confusion attacks against organizations with internal packages of the same name.

    npmCompromised packageDependency confusion
  4. resolvedcritical

    Malicious code in stillm4ddpocs-rtest-bravo (npm)

    The npm package stillm4ddpocs-rtest-bravo contained malicious code in its preinstall script that automatically executed during installation, collecting system information and internal package metadata and exfiltrating it to a third-party Interactsh collector via HTTPS and DNS tunneling.

    npmCompromised package