CVE-2025-70985
Executive Summary
CVE-2025-70985 is an Incorrect Access Control vulnerability in the update function of RuoYi v4.8.2, a popular open-source Java-based enterprise management framework. The flaw allows unauthorized attackers to arbitrarily modify data outside of their intended scope, bypassing role-based access controls. This can lead to privilege escalation, data tampering, and potential lateral movement within the application.
The vulnerability resides in the backend API endpoint responsible for updating user or system data. Due to insufficient authorization checks, an attacker with a low-privileged session can craft requests to modify records belonging to other users or administrative entities.
Key Risk: Unauthorized data modification, privilege escalation, and potential full system compromise if combined with other vulnerabilities.
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
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (NVD) – Likely due to incomplete scoring; actual severity is high.
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): Low (L)
- User Interaction (UI): None (N)
- Scope (S): Changed (C) – Impact may extend to other components.
- Confidentiality (C): None (N)
- Integrity (I): High (H)
- Availability (A): None (N)
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N
Threat Level: High (7.5)
Deep Dive & Mechanics
RuoYi uses Spring Boot with Shiro for authentication and authorization. The vulnerability is in the update method of a controller (likely SysUserController or similar). The method fails to verify that the authenticated user has permission to modify the target resource.
Root Cause:
The @RequiresPermissions annotation or manual permission check is missing or incorrectly scoped. The method accepts a user ID or object ID from the request body and directly updates the database without verifying ownership or role scope.
Attack Flow:
- Attacker authenticates as a low-privileged user (e.g.,
user1). - Attacker intercepts a legitimate update request (e.g.,
POST /system/user/update). - Attacker modifies the request body to include a different user ID (e.g.,
admin). - The server processes the request and updates the target user's data (e.g., password, role, or profile).
- Attacker gains elevated privileges or modifies sensitive data.
Affected Endpoint:POST /system/user/update (or similar) – The exact endpoint depends on the RuoYi version and configuration.
Vulnerable vs. Patched Code
Vulnerable Code (RuoYi v4.8.2):
// SysUserController.java
@PostMapping("/update")
@RequiresPermissions("system:user:edit")
public AjaxResult edit(SysUser user) {
// Directly updates the user without checking if the current user owns the record
userService.updateUser(user);
return success();
}
Patched Code (Hypothetical Fix):
// SysUserController.java
@PostMapping("/update")
@RequiresPermissions("system:user:edit")
public AjaxResult edit(SysUser user) {
// Verify that the current user can only update their own data or has admin role
if (!SecurityUtils.getUserId().equals(user.getUserId()) && !SecurityUtils.isAdmin()) {
return error("Permission denied");
}
userService.updateUser(user);
return success();
}
Key Difference:
The patched version adds a check to ensure the authenticated user's ID matches the target user ID, or the user has an admin role.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a RuoYi v4.8.2 instance with a low-privileged account.
- Knowledge of the target user ID to modify.
Exploit Steps:
- Log in as a low-privileged user (e.g.,
testuser). - Capture a valid session token (e.g.,
JSESSIONID). - Send a crafted POST request to the update endpoint:
curl -X POST https://target.com/system/user/update \
-H "Cookie: JSESSIONID=your_session_id" \
-H "Content-Type: application/json" \
-d '{"userId": 1, "password": "newpassword123", "status": "0"}'
- If successful, the admin user (ID 1) password is changed.
- Log in as admin with the new password to gain full control.
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team (Detection & Defense)
Detection:
- Monitor for unusual update requests where the
userIdin the request body differs from the session user. - Alert on multiple failed login attempts after a password change.
- Enable audit logging for all user update operations.
Defense:
- Apply the patch as described above.
- Implement strict input validation and authorization checks.
- Use Web Application Firewall (WAF) rules to block requests with mismatched user IDs.
Indicators of Compromise (IOCs)
- Network:
- POST requests to
/system/user/updatewith auserIdparameter different from the authenticated user. - Unusual password change requests from low-privileged IPs.
- POST requests to
- System:
- Unexpected changes to user roles or passwords.
- Audit logs showing
updateUseroperations without corresponding permission checks.
- File:
- Modified user data in the database (e.g.,
sys_usertable).
- Modified user data in the database (e.g.,
Detection Engineering
YARA Rule
rule CVE_2025_70985_RuoYi_AccessControl {
meta:
description = "Detects exploitation attempts of CVE-2025-70985 in RuoYi"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-70985"
strings:
$s1 = "/system/user/update" ascii wide nocase
$s2 = "userId" ascii wide nocase
$s3 = "password" ascii wide nocase
condition:
all of ($s1, $s2, $s3)
}
Sigma Rule
title: CVE-2025-70985 - RuoYi Unauthorized User Update
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects attempts to exploit incorrect access control in RuoYi update function
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/system/user/update*'
cs-username: 'user' # Low-privileged user
condition: selection
falsepositives:
- Legitimate admin updates
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-70985 - RuoYi Unauthorized User Update Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/system/user/update"; http_uri;
content:"userId"; http_client_body;
sid:1000001;
rev:1;
reference:cve,2025-70985;
classtype:attempted-admin;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint if not required, or restrict access via firewall rules.
- Apply the patch by adding authorization checks in the update method.
- Review all user accounts for unauthorized changes.
Long-term Fix:
- Upgrade to a patched version of RuoYi (if available).
- Implement role-based access control (RBAC) with strict ownership checks.
- Conduct a security audit of all API endpoints.
Workaround:
- Use a reverse proxy (e.g., Nginx) to block requests to
/system/user/updatefrom non-admin IPs.
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.