CVE-2020-7787 Improper Authentication

High 8.2 Published Updated

Attackers can bypass authentication in react-adal by exploiting storage logic to validate crafted JWT tokens as authentic.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2020-7787?

CVE-2020-7787 is a high-severity authentication bypass vulnerability in react-adal, published on 9 Dec 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

This affects all versions of package react-adal. 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.

Weakness: CWE-287

Which versions are affected by CVE-2020-7787?

2 open source packages ship an affected version, including react-adal. It affects 1 product.

PackageAffectedFixed in
react-adal npmAll versions0.5.1
react-adal npmAll versions0.5.1

Products include React-Adal Project React-Adal.

How do I fix CVE-2020-7787?

Upgrade react-adal to 0.5.1 or later.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2020-7787 being exploited?

There is no known exploitation of CVE-2020-7787 in the wild and no public exploit code.

Sources

Also known as GHSA-7mpx-vg3c-cmr4.

Is CVE-2020-7787 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free