Advisory

GHSA-xgh6-85xh-479p

Also known as: CVE-2020-7754, GHSA-pw54-mh39-w3hc

Summary

Regular Expression Denial of Service in npm-user-validate

Details

npm-user-validate before version 1.0.1 is vulnerable to a Regular Expression Denial of Service (REDos). The regex that validates user emails took exponentially longer to process long input strings beginning with @ characters.

Impact
The issue affects the email function. If you use this function to process arbitrary user input with no character limit the application may be susceptible to Denial of Service.

Patches
The issue is patched in version 1.0.1 by improving the regular expression used and also enforcing a 254 character limit.

Workarounds
Restrict the character length to a reasonable degree before passing a value to .emal(); Also, consider doing a more rigorous sanitizing/validation beforehand.

Severity

Low Basis: The source's own band: LOW

Dates

Published
2020-10-16 18:56 UTC
Modified
2026-07-08 06:49 UTC

Affected packages and fixes

npm-user-validate

npm · All systems

Affected

  • introduced 0, fixed 1.0.1 (semver)

Fixed versions

1.0.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences