CVE-2020-6506: React native webview Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-36j3-xxf7-4pqg
CVSS 6.5
CWE-79 CWE-863
Published
Advisory Summary

CVE-2020-6506 is a MODERATE (CVSS 6.5) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting React native webview libraries in the npm ecosystem. The issue involves android webview universal cross-site scripting. Remediation is available by upgrading affected packages to version 11.0.0.

CVE-2020-6506 at a Glance

CVE Identifier CVE-2020-6506
GHSA Identifier GHSA-36j3-xxf7-4pqg
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product React native webview
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.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:R/S:U/C:N/I:H/A:N).

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

How to Fix CVE-2020-6506

To remediate this vulnerability, upgrade all affected React native webview 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-webview fixed: 11.0.0
npm install react-native-webview@11.0.0
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-webview

How to Check if You Are Affected

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

npm ls react-native-webview

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

Note: The npm ls react-native-webview 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In React native webview, 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 universal cross-site scripting (UXSS) vulnerability, CVE-2020-6506 (https://crbug.com/1083819), has been identified in the Android WebView system component, which allows cross-origin iframes to execute arbitrary JavaScript in the top-level document. This vulnerability affects React Native apps which use a `react-native-webview` that allows navigation to arbitrary URLs, and when that app runs on systems with an Android WebView version prior to 83.0.4103.106. ## Pending mitigation Ensure users update their Android WebView system component via the Google Play Store to 83.0.4103.106 or higher to avoid this UXSS. 'react-native-webview' is working on a mitigation but it could take some time. ### References https://alesandroortiz.com/articles/uxss-android-webview-cve-2020-6506/

CVE-2020-6506 Affected React native webview Versions

1 component(s)
Fixed Versions:
11.0.0
Product / Package Ecosystem Affected Versions Fixed Version
react-native-webview
npm
< 11.0.0
11.0.0

References

GitHub Advisory / Wiki ADVISORY
https://github.com/react-native-community/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg
GitHub Advisory / Wiki ADVISORY
https://github.com/react-native-webview/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg
NVD — CVE-2020-6506 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-6506
React native webview Source Repository REPOSITORY
https://github.com/react-native-webview/react-native-webview/pull/1747
www.npmjs.com/advisories/1560 WEB
https://www.npmjs.com/advisories/1560
React native webview Security Information SECURITY
https://security.gentoo.org/glsa/202101-30
React native webview Security Information SECURITY
https://security.gentoo.org/glsa/202007-08
lists.apache.org/thread.html/rf08283... WEB
https://lists.apache.org/thread.html/rf082834ad237f78a63671aec0cef8874f9232b7614529cc3d3e304c5@%3Ccommits.cordova.apache.org%3E
lists.apache.org/thread.html/rc81e12... WEB
https://lists.apache.org/thread.html/rc81e12fc9287f8743d59099b1af40f968f1cfec9eac98a63c2c62c69@%3Cissues.cordova.apache.org%3E
lists.apache.org/thread.html/rc0ebe6... WEB
https://lists.apache.org/thread.html/rc0ebe639927fa09e222aa56bf5ad6e700218f334ecc6ba9da4397728@%3Cissues.cordova.apache.org%3E
lists.apache.org/thread.html/ra58733... WEB
https://lists.apache.org/thread.html/ra58733fbb88d5c513b3f14a14850083d506b9129103e0ab433c3f680@%3Cissues.cordova.apache.org%3E
lists.apache.org/thread.html/r2769c3... WEB
https://lists.apache.org/thread.html/r2769c33da7f7ece7e4e31837c1e1839d6657c7c13bb8d228670b8da0@%3Cissues.cordova.apache.org%3E
lists.apache.org/thread.html/r1eadf3... WEB
https://lists.apache.org/thread.html/r1eadf38b38ee20405811958c8a01f78d6b28e058c84c9fa6c1a8663d@%3Cissues.cordova.apache.org%3E
lists.apache.org/thread.html/r1ab80f... WEB
https://lists.apache.org/thread.html/r1ab80f8591d5c2147898076e3945dad1c897513630aabec556883275@%3Cissues.cordova.apache.org%3E
React native webview Release RELEASE
https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0
React native webview Source Repository REPOSITORY
https://github.com/react-native-community/react-native-webview
crbug.com/1083819 WEB
https://crbug.com/1083819
chromereleases.googleblog.com/2020/06/stable-chan... WEB
https://chromereleases.googleblog.com/2020/06/stable-channel-update-for-desktop_15.html
alesandroortiz.com/articles/uxss-andro... WEB
https://alesandroortiz.com/articles/uxss-android-webview-cve-2020-6506

Frequently Asked Questions

What is CVE-2020-6506?
CVE-2020-6506 is a security vulnerability in React native webview involving Android WebView Universal Cross-site Scripting under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which React native webview versions are affected?
Affected versions include releases prior to 11.0.0 across affected packages: react-native-webview.
What version fixes CVE-2020-6506?
Upgrading to 11.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is react-native-webview affected?
Yes, react-native-webview is affected in releases prior to 11.0.0. Upgrade your dependency to 11.0.0 or later.
What is the CVSS score of CVE-2020-6506?
CVE-2020-6506 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2020-6506?
CVE-2020-6506 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2020-6506?
Run the dependency tree command: 'npm ls react-native-webview'. 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-36j3-xxf7-4pqg",
  "modified" : "2022-08-03T23:40:07Z",
  "published" : "2020-10-02T16:22:41Z",
  "aliases" : [ "CVE-2020-6506" ],
  "summary" : "Android WebView Universal Cross-site Scripting",
  "details" : "A universal cross-site scripting (UXSS) vulnerability, CVE-2020-6506 (https://crbug.com/1083819), has been identified in the Android WebView system component, which allows cross-origin iframes to execute arbitrary JavaScript in the top-level document. This vulnerability affects React Native apps which use a `react-native-webview` that allows navigation to arbitrary URLs, and when that app runs on systems with an Android WebView version prior to 83.0.4103.106.\n\n## Pending mitigation\n\nEnsure users update their Android WebView system component via the Google Play Store to 83.0.4103.106 or higher to avoid this UXSS. 'react-native-webview' is working on a mitigation but it could take some time.\n\n### References\n\nhttps://alesandroortiz.com/articles/uxss-android-webview-cve-2020-6506/\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "react-native-webview"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.10.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/react-native-community/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/react-native-webview/react-native-webview/security/advisories/GHSA-36j3-xxf7-4pqg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-6506"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/react-native-webview/react-native-webview/pull/1747"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1560"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202101-30"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202007-08"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf082834ad237f78a63671aec0cef8874f9232b7614529cc3d3e304c5@%3Ccommits.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc81e12fc9287f8743d59099b1af40f968f1cfec9eac98a63c2c62c69@%3Cissues.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc0ebe639927fa09e222aa56bf5ad6e700218f334ecc6ba9da4397728@%3Cissues.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ra58733fbb88d5c513b3f14a14850083d506b9129103e0ab433c3f680@%3Cissues.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r2769c33da7f7ece7e4e31837c1e1839d6657c7c13bb8d228670b8da0@%3Cissues.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r1eadf38b38ee20405811958c8a01f78d6b28e058c84c9fa6c1a8663d@%3Cissues.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r1ab80f8591d5c2147898076e3945dad1c897513630aabec556883275@%3Cissues.cordova.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/react-native-community/react-native-webview"
  }, {
    "type" : "WEB",
    "url" : "https://crbug.com/1083819"
  }, {
    "type" : "WEB",
    "url" : "https://chromereleases.googleblog.com/2020/06/stable-channel-update-for-desktop_15.html"
  }, {
    "type" : "WEB",
    "url" : "https://alesandroortiz.com/articles/uxss-android-webview-cve-2020-6506"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-10-02T16:22:01Z",
    "nvd_published_at" : "2020-07-22T17:15:00Z"
  }
}