Critical Malicious Code Vulnerability in react-hook-form-persist Package

react-hook-form-persist Updated 25 Nov 2025

Summary

24/11/2025
CRITICAL
No i
Critical
Not published

MAL-2025-190990: Malicious code in react-hook-form-persist (npm). Affects react-hook-form-persist versions 3.0.1 – 3.0.2. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The react-hook-form-persist package is a popular library in the npm ecosystem that facilitates the persistence of form data in React applications. It allows developers to save form state in local storage, enhancing user experience by retaining input data across sessions. However, this package has been found to contain malicious code, compromising the security of any application that utilizes it.

Vulnerability Detail

The vulnerability stems from the inclusion of malicious code within the react-hook-form-persist package. This code can lead to a complete compromise of any system where the package is installed, allowing unauthorized access to sensitive information such as secrets and keys. The malicious nature of the code has been confirmed by multiple sources, including Amazon Inspector and GHSA malware reports, indicating that the package should be treated as a severe security threat.

How To Fix

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

npm uninstall react-hook-form-persist

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 measure, you can avoid using the react-hook-form-persist package and implement your own form persistence logic using local storage or other methods. For example, you can manually save form data to local storage like this:

const saveFormData = (data) => {
  localStorage.setItem('formData', JSON.stringify(data));
};

const loadFormData = () => {
  return JSON.parse(localStorage.getItem('formData')) || {};
};

Conclusion

The discovery of malicious code in the react-hook-form-persist package poses a significant risk to applications using it. Immediate action is required to mitigate potential damage, including uninstalling the package and rotating sensitive information. Users are encouraged to monitor their systems for any signs of compromise.

See every vulnerability recorded for react-hook-form-persist →

Share this vulnerability

FAQ

It is a library that helps persist form data in React applications, allowing data to be saved in local storage.

The malicious code can compromise your system, allowing unauthorized access to sensitive information and potentially leading to data breaches.

You should immediately uninstall the package and rotate any secrets or keys that may have been exposed.

Yes, you can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.

While removing the package is essential, there is no guarantee that all malicious software resulting from its installation will be removed. A thorough security audit of your system is recommended.

How To Fix

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

npm uninstall react-hook-form-persist

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