Critical Malicious Code Vulnerability in image-to-uri Package
Summary
MAL-2025-190968: Malicious code in image-to-uri (npm). Affects image-to-uri versions 1.0.1 – 1.0.2. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The image-to-uri package is an npm library that allows developers to convert images into data URIs, facilitating the embedding of images directly into web pages. This package is widely used in web development for its simplicity and efficiency. However, it has recently been discovered to contain malicious code, posing significant security risks to applications that utilize it.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the image-to-uri package. This code can compromise any computer that has the package installed, potentially allowing unauthorized access to sensitive information, such as secrets and keys. The malicious code was identified by security researchers from Amazon Inspector and is classified under CWE-506, indicating that it contains code that appears to be malicious in nature. Users are advised to treat any system running this package as fully compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall image-to-uri
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, you can avoid using the image-to-uri package and consider alternative libraries that provide similar functionality without the associated risks. Additionally, ensure that your application is monitored for any suspicious activity.
Conclusion
The discovery of malicious code within the image-to-uri package poses a serious threat to applications using it. Immediate action is required to remove the package and secure any sensitive information. Users are encouraged to utilize tools like Vulert to monitor for vulnerabilities in their projects.
See every vulnerability recorded for image-to-uri →
FAQ
The image-to-uri package is an npm library used to convert images into data URIs for embedding in web applications.
You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your package-lock.json.
If you have the image-to-uri package installed, you should remove it immediately and rotate any sensitive information stored on the affected system.
Currently, there is no patched version of the image-to-uri package available. The best course of action is to remove the package entirely.
Failing to address this vulnerability can lead to unauthorized access to sensitive data, potential data breaches, and complete compromise of the affected system.