Skip to content

Jwttoken never expire after changed the password and logged out

High
azukaar published GHSA-hpvm-x7m8-3c6x Nov 28, 2023

Package

https://github.com/azukaar/Cosmos-Server

Affected versions

< 0.13.0

Patched versions

0.13.1

Description

Summary

Through usage, we have found that the jwttoken code does not work properly, posing some potential security risks.

Details

The vulnerability is related to the Authorization header used for user login. After logging out, the token in the Authorization header remains valid and does not expire.

This vulnerability allows an attacker to use the token to gain unauthorized access to the application or system even after the user has logged out, leading to potential data breaches, unauthorized modification or deletion of sensitive data, or other malicious activities.

PoC

step 1: before changed the password and logged out we have a jwt code

image

step 2 changed the password and logged out we have new jwt code

image

Then we noticed these 2 jwt codes also existed at the same time.

Video POC test logout

bandicam.2023-11-28.09-35-57-727.mp4

Impact

The Jwttoken vulnerability can have a significant impact on the security of an application or system protected by a token. The main impact of this vulnerability is that the token can be used indefinitely by any user or attacker who has access to it. This can lead to unauthorized access to sensitive information, as the user or attacker can bypass authentication and gain access to the application or system without a valid username and password.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2023-49091

Weaknesses

No CWEs

Credits