Malicious Code Execution Vulnerability in pixsvg Package

pixsvg Updated 30 Sep 2026

Summary

30/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17313: Malicious code in pixsvg (npm). Affects pixsvg versions 0.2.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The pixsvg package is a JavaScript library designed for processing SVG (Scalable Vector Graphics) files. It allows developers to manipulate SVG data and integrate it into web applications. However, the package has been found to contain a serious vulnerability that enables the execution of arbitrary JavaScript code, posing a significant security risk to applications that utilize it.

Vulnerability Detail

The vulnerability originates from the pixsvg module's export of the function fetchDataFromSvg(svgData). This function scans input SVG data for a specific comment format that embeds JavaScript code in a binary-encoded sequence. The function then reconstructs this sequence into a JavaScript string and executes it using eval(). This covert execution channel allows attackers to run malicious code in the host process, potentially leading to data breaches, unauthorized access, or other malicious activities. The function is publicly accessible but undocumented, making it a hidden threat for developers who may unknowingly expose their applications to risks by using this function.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall pixsvg

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the fetchDataFromSvg function in your application. Instead, consider using alternative methods for processing SVG data that do not involve executing JavaScript from untrusted sources.

Conclusion

The pixsvg package contains a critical vulnerability that allows for the execution of malicious JavaScript code through improperly handled SVG data. It is essential for developers using this package to update to the latest version and avoid using the vulnerable function to mitigate potential security risks.

See every vulnerability recorded for pixsvg →

Share this vulnerability

FAQ

The vulnerability allows for the execution of arbitrary JavaScript code embedded within SVG files, which can lead to security breaches.

You can use Vulert, a tool that monitors and alerts for open-source vulnerabilities, to check if your application is affected by this vulnerability.

If you cannot update the package, avoid using the vulnerable function fetchDataFromSvg and consider alternative methods for handling SVG data.

Yes, there is a risk of data loss or unauthorized access if an attacker exploits this vulnerability to execute malicious code.

More information can be found in the vulnerability report on the official GitHub repository or through security advisories related to the pixsvg package.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall pixsvg

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback