Vulnerabilities in pkg:npm/react-native

PACKAGE
Advisory Identifier: GHSA-7f53-fmmv-mfjv
Advisory Summary

CVE-2020-1920 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting React native libraries in the npm ecosystem. The issue involves regular expression denial of service in react-native. Remediation is available by upgrading affected packages to version 0.62.3, 0.64.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/react-native

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/react-native. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7f53-fmmv-mfjv CVE-2020-1920 HIGH Regular expression denial of service in react-native

CVE-2020-1920 at a Glance

CVE Identifier CVE-2020-1920
GHSA Identifier GHSA-7f53-fmmv-mfjv
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product React native
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2020-1920

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

react-native fixed: 0.62.3
npm install react-native@0.62.3
react-native fixed: 0.64.1
npm install react-native@0.64.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 react-native

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-1920, inspect your project dependencies using npm:

npm ls react-native

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

Note: The npm ls react-native 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 CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In React native, 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

A regular expression denial of service (ReDoS) vulnerability in the validateBaseUrl function can cause the application to use excessive resources, become unresponsive, or crash. This was introduced in react-native version 0.59.0 and fixed in version 0.64.1.

CVE-2020-1920 Affected React native Versions

2 component(s)
Fixed Versions:
0.62.30.64.1
Product / Package Ecosystem Affected Versions Fixed Version
react-native
npm
≥ 0.59.0
< 0.62.3
0.62.3
react-native
npm
≥ 0.63.0
< 0.64.1
0.64.1

References

Frequently Asked Questions

What is CVE-2020-1920?
CVE-2020-1920 is a security vulnerability in React native involving Regular expression denial of service in react-native under CWE-400: Uncontrolled Resource Consumption.
Which React native versions are affected?
Affected versions include releases prior to 0.62.3, 0.64.1 across affected packages: react-native.
What version fixes CVE-2020-1920?
Upgrading to 0.62.3, 0.64.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is react-native affected?
Yes, react-native is affected in releases prior to 0.62.3, 0.64.1. Upgrade your dependency to 0.62.3, 0.64.1 or later.
What is the CVSS score of CVE-2020-1920?
CVE-2020-1920 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2020-1920?
CVE-2020-1920 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2020-1920?
Run the dependency tree command: 'npm ls react-native'. 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-7f53-fmmv-mfjv",
  "modified" : "2021-06-10T14:10:51Z",
  "published" : "2021-07-20T17:33:28Z",
  "aliases" : [ "CVE-2020-1920" ],
  "summary" : "Regular expression denial of service in react-native",
  "details" : "A regular expression denial of service (ReDoS) vulnerability in the validateBaseUrl function can cause the application to use excessive resources, become unresponsive, or crash. This was introduced in react-native version 0.59.0 and fixed in version 0.64.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "react-native"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.59.0"
      }, {
        "fixed" : "0.62.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "react-native"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.63.0"
      }, {
        "fixed" : "0.64.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-1920"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/facebook/react-native/commit/ca09ae82715e33c9ac77b3fa55495cf84ba891c7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/facebook/react-native/releases/tag/v0.62.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/facebook/react-native/releases/tag/v0.64.1"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2020-293-redos-react-native"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/react-native"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-697" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-02T19:22:39Z",
    "nvd_published_at" : "2021-06-01T14:15:00Z"
  }
}