Critical Malicious Code Vulnerability in react-qr-image Package
Summary
MAL-2025-191007: Malicious code in react-qr-image (npm). Affects react-qr-image versions 1.1.1. 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 react-qr-image package is a popular npm library used for generating QR codes in React applications. It allows developers to easily integrate QR code functionality into their projects, providing a seamless user experience. However, recent findings have revealed that this package has been compromised, containing malicious code that poses significant security risks to users and their systems.
Vulnerability Detail
The vulnerability originates from the discovery of malicious code embedded within the react-qr-image package. This code can compromise any computer that has the package installed, potentially allowing unauthorized access to sensitive information, including secrets and keys stored on the affected system. The malicious code can lead to a complete takeover of the computer, making it imperative for users to act swiftly to mitigate the risks associated with this vulnerability.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall react-qr-image
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 workaround, users should immediately rotate any secrets and keys stored on the affected computer from a different, secure machine. Additionally, consider using alternative libraries for QR code generation that are known to be secure and free from malicious code.
Conclusion
The react-qr-image package has been found to contain malicious code, posing serious security risks to users. It is essential to uninstall the package immediately and take necessary precautions to secure sensitive information. Users are encouraged to explore alternative libraries for QR code generation and utilize tools like Vulert for ongoing vulnerability monitoring.
See every vulnerability recorded for react-qr-image →
FAQ
react-qr-image is an npm package that allows developers to generate QR codes in React applications easily.
The malicious code was identified through security assessments conducted by Amazon Inspector and reported by the GHSA.
If you have react-qr-image installed, you should immediately uninstall it and rotate any sensitive information stored on your system.
Yes, you can use Vulert, which monitors and alerts for open-source vulnerabilities using just your package-lock.json file. You can check your application at Vulert Scanner without needing to sign up.
Yes, consider using other QR code generation libraries that are verified to be secure, such as 'qrcode.react' or 'react-qr-code'.