GHSA-xgh6-85xh-479p: Npm user validate Denial of Service Vulnerability

LOW
Published
Advisory Summary

GHSA-xgh6-85xh-479p is a LOW denial of service vulnerability (General Security Weakness) affecting Npm user validate libraries in the npm ecosystem. The issue involves regular expression denial of service in npm-user-validate. Remediation is available by upgrading affected packages to version 1.0.1.

GHSA-xgh6-85xh-479p at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xgh6-85xh-479p
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Npm user validate
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-xgh6-85xh-479p

To remediate this vulnerability, upgrade all affected Npm user validate dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

npm-user-validate fixed: 1.0.1
npm install npm-user-validate@1.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls npm-user-validate

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-xgh6-85xh-479p, inspect your project dependencies using npm:

npm ls npm-user-validate

Analyze the terminal output to locate any version of Npm user validate in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.1), your application is affected.

Note: The npm ls npm-user-validate command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Npm user validate, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

`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.

GHSA-xgh6-85xh-479p Affected Npm user validate Versions

1 component(s)
Fixed Versions:
1.0.1
Product / Package Ecosystem Affected Versions Fixed Version
npm-user-validate
npm
< 1.0.1
1.0.1

References

Frequently Asked Questions

What is GHSA-xgh6-85xh-479p?
GHSA-xgh6-85xh-479p is a security vulnerability in Npm user validate involving Regular Expression Denial of Service in npm-user-validate under General Security Weakness.
Which Npm user validate versions are affected?
Affected versions include releases prior to 1.0.1 across affected packages: npm-user-validate.
What version fixes GHSA-xgh6-85xh-479p?
Upgrading to 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is npm-user-validate affected?
Yes, npm-user-validate is affected in releases prior to 1.0.1. Upgrade your dependency to 1.0.1 or later.
What CWE is associated with GHSA-xgh6-85xh-479p?
GHSA-xgh6-85xh-479p is classified under General Security Weakness.
How can I check npm dependencies for GHSA-xgh6-85xh-479p?
Run the dependency tree command: 'npm ls npm-user-validate'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xgh6-85xh-479p",
  "modified" : "2020-10-16T18:56:02Z",
  "published" : "2020-10-16T18:56:26Z",
  "aliases" : [ ],
  "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.\n\n### Impact\nThe 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.\n\n### Patches\nThe issue is patched in version 1.0.1 by improving the regular expression used and also enforcing a 254 character limit.\n\n### Workarounds\nRestrict the character length to a reasonable degree before passing a value to `.emal()`; Also, consider doing a more rigorous sanitizing/validation beforehand.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "npm-user-validate"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/npm/npm-user-validate/security/advisories/GHSA-xgh6-85xh-479p"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-10-16T18:56:02Z",
    "nvd_published_at" : null
  }
}