CVE-2024-31760
Executive Summary
CVE-2024-31760 identifies a privilege escalation vulnerability in the sanluan/flipped-aurora fork of gin-vue-admin version 2.4.x. The flaw resides in the Session Expiration component, allowing an attacker to bypass session termination controls and escalate their privileges within the application. This vulnerability is particularly dangerous in multi-tenant or administrative environments where session integrity is critical. No public proof-of-concept (PoC) or patch details are currently available, and the CVSS score is listed as 0.0, indicating incomplete or unassigned scoring. The EPSS score of 0.0% suggests low exploitation activity in the wild, but the lack of a patch elevates the risk for affected deployments.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a Go-based web application framework (gin-vue-admin). The project is distributed via GitHub and Go modules. Organizations using this framework should verify their dependency tree and ensure they are not using the vulnerable 2.4.x branch. Since no official patch exists, supply chain risk is high, and users should consider forking the repository to apply custom fixes or migrating to an alternative framework.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unassigned)
- Attack Vector (AV): UNKNOWN
- Attack Complexity (AC): UNKNOWN
- Privileges Required (PR): UNKNOWN
- User Interaction (UI): UNKNOWN
- Scope (S): UNKNOWN
- Confidentiality (C): UNKNOWN
- Integrity (I): UNKNOWN
- Availability (A): UNKNOWN
Threat Level: High (due to privilege escalation potential and lack of patch)
Deep Dive & Mechanics
The vulnerability is rooted in the Session Expiration component of gin-vue-admin (version 2.4.x). Session expiration mechanisms are designed to invalidate user sessions after a period of inactivity or upon explicit logout. In this case, the implementation fails to properly enforce session termination, allowing an attacker to reuse an expired or revoked session token to gain elevated privileges.
Technical Breakdown:
- Session Token Handling: The application uses JWT or similar tokens for session management. The expiration logic is flawed, possibly due to improper validation of token claims (e.g.,
expfield) or failure to check token revocation status. - Privilege Escalation: By manipulating the session token (e.g., replaying an old token or modifying claims), an attacker can assume the identity of a higher-privileged user (e.g., admin).
- Attack Vector: The attacker must have network access to the application and a valid (or previously valid) session token. This could be achieved through session hijacking, token leakage, or social engineering.
Root Cause: The session expiration component does not enforce server-side session invalidation, relying solely on client-side token expiration. This allows an attacker to bypass the expiration check by presenting a token that is still within its validity window but should have been revoked.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common fixes for session expiration vulnerabilities.
Vulnerable Code (gin-vue-admin 2.4.x):
// Vulnerable: Only checks token expiration client-side
func validateSession(token string) bool {
claims, err := jwt.Parse(token, keyFunc)
if err != nil {
return false
}
// Missing server-side revocation check
return claims.Valid
}
Patched Code (Hypothetical):
// Patched: Adds server-side revocation check
func validateSession(token string) bool {
claims, err := jwt.Parse(token, keyFunc)
if err != nil {
return false
}
// Check if token is revoked in database
if isTokenRevoked(claims.ID) {
return false
}
return claims.Valid
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to a valid session token (e.g., via session hijacking or token leakage).
- Network access to the target
gin-vue-admininstance.
Exploitation Steps:
- Intercept a valid session token (e.g., using Burp Suite or a proxy).
- Wait for the session to expire (or manually trigger logout).
- Replay the expired token in a request to a privileged endpoint (e.g.,
/api/admin/users). - If the server does not validate revocation, the request will succeed, granting elevated privileges.
Example Request:
GET /api/admin/users HTTP/1.1
Host: target.com
Authorization: Bearer <expired_token>
Blue Team
Detection:
- Monitor for repeated use of the same JWT token across different sessions.
- Alert on requests to privileged endpoints with tokens that have an
expclaim in the past. - Implement server-side session revocation and log all token validation failures.
Mitigation:
- Apply the hypothetical patch above.
- Use short-lived tokens and refresh token rotation.
- Implement IP-based or device fingerprinting to detect token reuse.
Indicators of Compromise (IOCs)
- Network: Repeated HTTP requests with the same JWT token after session expiration.
- Logs:
[WARN] Token validation failed: token expiredfollowed by successful access. - Files: Unusual access to
/api/admin/*endpoints from non-admin accounts. - Registry/Config: Modified session expiration settings in
config.yaml.
Detection Engineering
YARA Rule
rule CVE_2024_31760_Session_Expiration {
meta:
description = "Detects potential exploitation of CVE-2024-31760 via session token reuse"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2024-31760"
strings:
$jwt_pattern = /Bearer\s+[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/
$admin_endpoint = /\/api\/admin\//
condition:
$jwt_pattern and $admin_endpoint
}
Sigma Rule
title: CVE-2024-31760 Session Token Reuse
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects reuse of expired JWT tokens against admin endpoints
author: Valters IT
logsource:
category: webserver
product: nginx
detection:
selection:
http.method: 'GET'
http.url|contains: '/api/admin/'
http.authorization|contains: 'Bearer'
condition: selection
falsepositives:
- Legitimate token refresh mechanisms
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-31760 - Session Token Reuse Attempt"; flow:to_server; http.method; content:"GET"; http.uri; content:"/api/admin/"; http.header; content:"Authorization"; content:"Bearer"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable session persistence and enforce strict session expiration.
- Implement server-side token revocation using a blacklist or database.
- Upgrade to a patched version if available (check the official repository).
Long-term Fixes:
- Fork the repository and apply the hypothetical patch.
- Migrate to a maintained fork or alternative framework.
- Conduct a security audit of all session management components.
Compensating Controls:
- Use Web Application Firewall (WAF) rules to block repeated token usage.
- Enable multi-factor authentication (MFA) for all privileged accounts.
- Monitor logs for anomalous session behavior.
Valters IT