CVE-2024-31759
Executive Summary
CVE-2024-31759 identifies a privilege escalation vulnerability in sanluan PublicCMS version 4.0.202302.e. The flaw resides in the change password function, allowing an authenticated attacker to escalate their privileges within the application. This could lead to unauthorized access to administrative functions, data exfiltration, or full system compromise. The vulnerability is currently unpatched, and no public exploit code or proof-of-concept is available. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for organizations using this CMS.
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 Java-based CMS (PublicCMS). While not a package manager ecosystem (NPM, PyPI, Go, Ruby), the risk of supply chain compromise exists if the application is distributed via third-party repositories or bundled with dependencies. Organizations should verify the integrity of their PublicCMS installation and monitor for any unofficial patches or forks.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or unassigned. Based on the vulnerability description (privilege escalation via password change), a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N) – the function is accessible over the network.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): Low (L) – attacker needs a valid user account.
- User Interaction (UI): None (N) – no user action required beyond the attacker.
- Scope (S): Changed (C) – escalation can impact components beyond the vulnerable function.
- Confidentiality (C): High (H) – potential access to sensitive data.
- Integrity (I): High (H) – ability to modify system settings.
- Availability (A): High (H) – potential to disrupt service.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Estimated Base Score: 9.9 (Critical)
Threat Level: Critical – due to the potential for full administrative takeover.
Deep Dive & Mechanics
The vulnerability is in the "change password" functionality of PublicCMS. The exact mechanism is not publicly documented, but based on the description, it likely involves:
- Insufficient Authorization Checks: The password change endpoint may not properly verify that the requesting user has the right to change the target account's password. An attacker could craft a request to change the password of an administrative user.
- Parameter Manipulation: The request might include a user ID or username parameter that is not validated against the authenticated session. By altering this parameter, an attacker can change another user's password.
- Session or Token Weakness: The function might rely on weak session tokens or predictable identifiers that can be forged or reused.
Once the attacker changes an admin password, they can log in with escalated privileges and perform any administrative action.
Vulnerable vs. Patched Code
Since no patch is available, a direct code comparison is not possible. However, a secure implementation would:
Vulnerable Code (Conceptual):
// No check if the authenticated user is allowed to change the target user's password public void changePassword(String targetUsername, String newPassword) { User user = userRepository.findByUsername(targetUsername); user.setPassword(hash(newPassword)); userRepository.save(user); }Patched Code (Conceptual):
public void changePassword(String targetUsername, String newPassword, Authentication auth) { // Verify the authenticated user is either the target user or an admin if (!auth.getName().equals(targetUsername) && !auth.getAuthorities().contains("ROLE_ADMIN")) { throw new AccessDeniedException("Not authorized"); } User user = userRepository.findByUsername(targetUsername); user.setPassword(hash(newPassword)); userRepository.save(user); }
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A valid user account on the target PublicCMS instance.
- Network access to the password change endpoint (e.g.,
/admin/user/changePassword).
Exploitation Steps:
- Intercept Request: Use a proxy (e.g., Burp Suite) to capture a legitimate password change request.
- Modify Parameters: Change the
usernameoruserIdparameter to an administrative account (e.g.,admin). - Send Request: Forward the modified request.
- Verify: Log out and log in with the admin account using the new password.
Example Request (cURL):
curl -X POST https://target.com/admin/user/changePassword \
-H "Cookie: JSESSIONID=your_session_id" \
-d "username=admin&newPassword=Hacked123&confirmPassword=Hacked123"
Note: No public exploit code is available. The above is a conceptual example.
Blue Team (Detection & Defense)
Detection:
- Monitor for password change requests where the
usernameparameter differs from the authenticated session user. - Alert on multiple failed login attempts followed by a successful login from a different IP.
- Log all password change events with source IP, user agent, and target username.
Defense:
- Implement strict server-side authorization checks (as shown in the patched code).
- Use multi-factor authentication (MFA) for administrative accounts.
- Apply the principle of least privilege – limit the number of admin accounts.
- Monitor for anomalous password change patterns (e.g., bulk changes, off-hours changes).
Indicators of Compromise (IOCs)
- Network:
- HTTP POST requests to
/admin/user/changePasswordwith a modifiedusernameparameter. - Unusual login patterns from the same IP after a password change.
- HTTP POST requests to
- System:
- Unexpected changes to user roles or permissions in the database.
- New admin accounts created after a password change.
- Logs:
- Application logs showing password changes for accounts other than the authenticated user.
- Audit logs with missing or inconsistent user identifiers.
Detection Engineering
YARA Rule
rule CVE_2024_31759_Password_Change_Abuse {
meta:
description = "Detects potential privilege escalation via password change in PublicCMS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-31759"
strings:
$s1 = "changePassword" ascii wide nocase
$s2 = "username=" ascii wide nocase
$s3 = "admin" ascii wide nocase
condition:
all of ($s1, $s2, $s3)
}
Sigma Rule
title: PublicCMS Privilege Escalation via Password Change
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to change another user's password in PublicCMS
author: Valters IT
date: 2025/04/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-31759
logsource:
category: application
product: publiccms
detection:
selection:
EventID: 4672 # Special privileges assigned to new logon (Windows) or custom app log
TargetUsername|re: '^(?!%CurrentUser%).*$' # Target user is not the current user
Action: 'Password Change'
condition: selection
falsepositives:
- Legitimate admin changing another user's password
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-31759 - PublicCMS Privilege Escalation via Password Change";
flow:to_server,established;
content:"POST"; http_method;
content:"/admin/user/changePassword"; http_uri;
content:"username="; http_client_body;
pcre:"/username=(?!%{CURRENT_USER})/Ri"; # Target user differs from current user
sid:1000001;
rev:1;
reference:cve,2024-31759;
classtype:attempted-admin;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable Password Change Function: If possible, temporarily disable the password change endpoint until a patch is available.
- Restrict Access: Use a Web Application Firewall (WAF) to block requests to
/admin/user/changePasswordexcept from trusted IPs. - Audit User Accounts: Review all user accounts for unauthorized changes.
Long-Term Fix:
- Apply server-side authorization checks (as described in the patched code section).
- Upgrade to a patched version once released by the vendor.
- Implement robust logging and monitoring for all authentication-related events.
Workaround:
- If source code is accessible, manually add authorization checks to the password change function.
Valters IT