Skip to main content

CVE-2021-25985: CWE-613 Insufficient Session Expiration in FactorJS Factor

High
VulnerabilityCVE-2021-25985cvecve-2021-25985cwe-613
Published: Tue Nov 16 2021 (11/16/2021, 09:45:19 UTC)
Source: CVE
Vendor/Project: FactorJS
Product: Factor

Description

In Factor (App Framework & Headless CMS) v1.0.4 to v1.8.30, improperly invalidate a user’s session even after the user logs out of the application. In addition, user sessions are stored in the browser’s local storage, which by default does not have an expiration time. This makes it possible for an attacker to steal and reuse the cookies using techniques such as XSS attacks, followed by a local account takeover.

AI-Powered Analysis

AILast updated: 06/25/2025, 09:01:30 UTC

Technical Analysis

CVE-2021-25985 is a high-severity vulnerability affecting FactorJS's Factor product versions 1.0.4 through 1.8.30. The core issue is insufficient session expiration management (CWE-613). Specifically, when a user logs out, the application fails to properly invalidate the user's session tokens. Moreover, user session data is stored in the browser's local storage, which inherently lacks an expiration mechanism. This combination allows an attacker who can execute cross-site scripting (XSS) attacks to steal session cookies or tokens from local storage and reuse them to hijack user accounts. The vulnerability impacts confidentiality, integrity, and availability because an attacker can gain unauthorized access (confidentiality), perform actions as the victim (integrity), and potentially disrupt service (availability). The CVSS 3.1 score of 7.8 reflects a high severity, with an attack vector limited to local (AV:L), low attack complexity (AC:L), no privileges required (PR:N), but requiring user interaction (UI:R). The scope is unchanged (S:U), and the impact on confidentiality, integrity, and availability is high (C:H/I:H/A:H). No known exploits have been reported in the wild, and no official patches are linked, indicating that mitigation may rely on configuration changes or updates from the vendor. The vulnerability arises from poor session management practices and unsafe storage of session tokens in local storage, which is accessible via JavaScript and thus vulnerable to XSS attacks. This makes it critical for applications using FactorJS Factor to review their session handling and storage mechanisms to prevent session hijacking and account takeover risks.

Potential Impact

For European organizations using FactorJS Factor, this vulnerability poses a significant risk of account takeover through session hijacking. Attackers exploiting this flaw can access sensitive user data, manipulate application functions, and potentially disrupt business operations. Sectors such as finance, healthcare, government, and critical infrastructure that rely on FactorJS Factor for web applications or headless CMS capabilities are particularly at risk. The vulnerability undermines user trust and may lead to regulatory non-compliance, especially under GDPR, due to unauthorized access and potential data breaches. The local storage of session tokens increases the attack surface, especially if combined with other vulnerabilities like XSS. Given the high confidentiality and integrity impact, organizations could face data leakage, fraud, and service disruption. The requirement for user interaction (e.g., clicking a malicious link) means phishing or social engineering could be used to facilitate exploitation. The absence of known exploits in the wild suggests a window for proactive mitigation before widespread attacks occur.

Mitigation Recommendations

Immediately update FactorJS Factor to the latest version once the vendor releases a patch addressing this vulnerability. Implement server-side session invalidation upon logout to ensure tokens are revoked and cannot be reused. Avoid storing session tokens or sensitive authentication data in browser local storage; use secure, HttpOnly cookies with appropriate SameSite attributes instead. Conduct thorough input validation and output encoding to prevent XSS vulnerabilities that could be leveraged to steal session tokens. Implement Content Security Policy (CSP) headers to restrict the execution of unauthorized scripts and reduce XSS attack vectors. Educate users about phishing and social engineering risks to reduce the likelihood of user interaction leading to exploitation. Regularly audit and monitor web application logs for suspicious activities indicative of session hijacking attempts. Use multi-factor authentication (MFA) to add an additional layer of security, reducing the impact of stolen session tokens. Deploy web application firewalls (WAF) configured to detect and block common XSS attack patterns targeting session tokens. Review and enhance session management policies, including setting appropriate session timeouts and secure cookie flags.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Mend
Date Reserved
2021-01-22T00:00:00.000Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d983bc4522896dcbedd0f

Added to database: 5/21/2025, 9:09:15 AM

Last enriched: 6/25/2025, 9:01:30 AM

Last updated: 8/17/2025, 7:15:03 PM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats