Heimdal Security Blog

High Severity Vulnerability Discovered in the JsonWebToken Library

The open-source JsonWebToken (JWT) library has been confirmed to be affected by a high-severity security flaw that could lead to remote code execution.

While investigating the popular open-source project, Unit 42 researchers discovered a new vulnerability, tracked as CVE-2022-23529.This flaw has been rated as high severity with a CVSS score of 7.6, and according to the cybersecurity researchers, an attacker could exploit this vulnerability to obtain RCE by migrating a maliciously crafted JWT request to a server that verifies the request.

There are more than 22,000 open-source projects using the JsonWebToken library on NPM and has been downloaded over 36 million times in the last month alone. This basically means an average of more than 9 million downloads per week.

In their advisory, security analysts have strongly recommended users immediately update their JsonWebToken package version to 9.0.0, since this latest version includes the security patch that addresses the flaw.

Several giant companies have used the library in their open-source projects, such as:

JSON Authentication Process

JSON web tokens are used as a simple authentication method:

Authentication process with JWT.

Source

Now, when malicious JWS tokens are used, threat actors are able to execute code on servers remotely. As a result of the vulnerability, JsonWebToken’s verify method allows this to be performed with no authentication, and it returns the decoded information to the user.

As Cyber Security News also points out, because there is no check to determine whether the ‘secretOrPublicKey’ parameter contains a string or a buffer, an attacker could use a specially crafted object to perform arbitrary file writes.

Source

Despite the difficulty of exploiting this vulnerability, threat actors are eager to exploit it given the number of potential targets. As a result, system administrators should ensure that the security update is applied as soon as possible.

If you liked this article, follow us on LinkedInTwitterFacebookYoutube, and Instagram for more cybersecurity news and topics.