Vulnerabilities in pkg:npm/react-adal
PACKAGECVE-2020-7787 is a HIGH (CVSS 8.2) improper authentication vulnerability (CWE-287: Improper Authentication) affecting React adal libraries in the npm ecosystem. The issue involves improper authentication in react-adal. Remediation is available by upgrading affected packages to version 0.5.1.
pkg:npm/react-adal
Vulnerability advisories affecting package pkg:npm/react-adal. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7mpx-vg3c-cmr4 | CVE-2020-7787 | HIGH | Improper Authentication in react-adal |
CVE-2020-7787 at a Glance
Security Impact
CVSS: 8.2
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:H/I:L/A:N).
How to Fix CVE-2020-7787
To remediate this vulnerability, upgrade all affected React adal 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 install react-adal@0.5.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls react-adal
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-7787, inspect your project dependencies using npm:
npm ls react-adal
Analyze the terminal output to locate any version of React adal in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.1), your application is affected.
Note: The npm ls react-adal 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In React adal, 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
CVE-2020-7787 Affected React adal Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
react-adal
|
npm |
< 0.5.1
|
0.5.1
|
References
Frequently Asked Questions
What is CVE-2020-7787?
Which React adal versions are affected?
What version fixes CVE-2020-7787?
Is react-adal affected?
What is the CVSS score of CVE-2020-7787?
What CWE is associated with CVE-2020-7787?
How can I check npm dependencies for CVE-2020-7787?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7mpx-vg3c-cmr4",
"modified" : "2021-04-09T19:38:58Z",
"published" : "2021-04-13T15:22:37Z",
"aliases" : [ "CVE-2020-7787" ],
"summary" : "Improper Authentication in react-adal",
"details" : "This affects versions of react-adal < 0.5.1. It is possible for a specially crafted JWT token and request URL can cause the nonce, session and refresh values to be incorrectly validated, causing the application to treat an attacker-generated JWT token as authentic. The logical defect is caused by how the nonce, session and refresh values are stored in the browser local storage or session storage. Each key is automatically appended by ||. When the received nonce and session keys are generated, the list of values is stored in the browser storage, separated by ||, with || always appended to the end of the list. Since || will always be the last 2 characters of the stored values, an empty string (\"\") will always be in the list of the valid values. Therefore, if an empty session parameter is provided in the callback URL, and a specially-crafted JWT token contains an nonce value of \"\" (empty string), then adal.js will consider the JWT token as authentic.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "react-adal"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7787"
}, {
"type" : "WEB",
"url" : "https://github.com/salvoravida/react-adal/pull/115"
}, {
"type" : "WEB",
"url" : "https://github.com/salvoravida/react-adal/commit/74158dba1647b12fe96fa401e306a6287fe9e2a9"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-REACTADAL-1018907"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-09T19:38:58Z",
"nvd_published_at" : "2020-12-09T17:15:00Z"
}
}