Regular Expression Denial of Service in npm-user-validate

npm-user-validate Updated 02 Oct 2025

Summary

16/10/2020
LOW
Yes i
Low
Not published

GHSA-xgh6-85xh-479p: Regular Expression Denial of Service in npm-user-validate. Affects npm-user-validate versions < 1.0.1. Fixed in 1.0.1. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

npm-user-validate is an npm package that provides functions for validating user input, specifically email addresses. It is commonly used in applications that require email validation. However, versions before 1.0.1 of npm-user-validate are vulnerable to a Regular Expression Denial of Service (REDos) attack. This vulnerability arises from the regex used to validate user emails, which can cause the application to become unresponsive when processing long input strings starting with '@' characters.

Vulnerability Detail

The vulnerability affects the 'email' function in npm-user-validate. If this function is used to process user input without any character limit, an attacker can exploit it to launch a Denial of Service (DoS) attack. By providing a long input string starting with '@' characters, the regex used for validation takes exponentially longer to process, leading to a significant impact on the application's performance and availability.

How To Fix

Minimum fixed version

1.0.1

This is the first release that contains the fix.

npm install npm-user-validate@1.0.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating to the latest version is not immediately feasible, it is advisable to restrict the character length of input values before passing them to the '.email()' function. Additionally, implementing a more rigorous sanitization and validation process for user input can help mitigate the risk of this vulnerability.

Conclusion

In conclusion, npm-user-validate versions before 1.0.1 are vulnerable to a Regular Expression Denial of Service (REDos) attack. This can be exploited to launch a Denial of Service (DoS) attack on applications using this package. To mitigate the risk, it is crucial to update to the latest version of npm-user-validate (1.0.1) or implement the recommended workarounds. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for npm-user-validate →

Share this vulnerability

FAQ

npm-user-validate is an npm package used for validating user input, particularly email addresses.

A Regular Expression Denial of Service (REDos) attack is a type of Denial of Service (DoS) attack that exploits the inefficiency of certain regular expressions. By providing specially crafted input, an attacker can cause the regex to take an excessive amount of time to process, leading to a significant impact on the application's performance and availability.

The vulnerability in npm-user-validate can be exploited to launch a Denial of Service (DoS) attack. By providing a long input string starting with '@' characters, an attacker can cause the application to become unresponsive and unavailable, impacting its performance and potentially disrupting its functionality.

To fix the vulnerability, it is recommended to update to version 1.0.1 of npm-user-validate. This version includes improvements to the regular expression used for email validation and enforces a character limit of 254. Updating to the latest version will mitigate the risk of the vulnerability.

If updating to the latest version is not immediately feasible, you can mitigate the risk by restricting the character length of input values before passing them to the '.email()' function in npm-user-validate. Additionally, implementing a more rigorous sanitization and validation process for user input can help reduce the impact of this vulnerability.

References

Related vulnerabilities

Recent vulnerabilities recorded for npm-user-validate.

How To Fix

Minimum fixed version

1.0.1

This is the first release that contains the fix.

npm install npm-user-validate@1.0.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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