Skip to content

Improper Authentication in react-adal

High severity GitHub Reviewed Published Apr 13, 2021 to the GitHub Advisory Database • Updated Feb 1, 2023

Package

npm react-adal (npm)

Affected versions

< 0.5.1

Patched versions

0.5.1

Description

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.

References

Published by the National Vulnerability Database Dec 9, 2020
Reviewed Apr 9, 2021
Published to the GitHub Advisory Database Apr 13, 2021
Last updated Feb 1, 2023

Severity

High
8.2
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

Weaknesses

CVE ID

CVE-2020-7787

GHSA ID

GHSA-7mpx-vg3c-cmr4

Source code

No known source code
Checking history
See something to contribute? Suggest improvements for this vulnerability.