/

CVE-2025-70985

Severity:

CRITICAL RISK

(9.1)

Broken Access Control in RuoYi v4.8.2 Update Function

CVE-2025-70985

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-284, CWE-862

Impact:

Unauthorized Data Modification and Privilege Abuse

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

RuoYi v4.8.2 contains an incorrect access control implementation in its update functionality, allowing users to modify records that should be outside their authorized scope.

An attacker who can reach the vulnerable update endpoint may be able to arbitrarily change data belonging to other users or higher-privileged contexts, leading to severe integrity and privilege abuses.

Affected context

This weakness occurs in RuoYi v4.8.2 where business objects are updated via server-side endpoints that do not properly enforce authorization checks on the target resource.

The issue typically appears when the application:

  • Relies on client-supplied identifiers (IDs, organization codes, user IDs, etc.) for selecting records to update
  • Performs only authentication or role checks, but not fine-grained ownership or scope checks
  • Omits or misconfigures permission annotations, interceptors, or access control filters around the update logic

Exploit preconditions

  • Attack surface: HTTP(S) API or web interface exposing the update operation
  • Required access: Network access to the RuoYi instance and the ability to invoke the update function (e.g., via a normal or low-privileged account; in some deployments, potentially unauthenticated)
  • Trigger point: Submitting a crafted update request that references data outside the attacker's allowed scope (such as another user's record or a different tenant/department)
  • Why exploitation is possible: The server trusts the incoming identifiers and applies updates without verifying that the caller is authorized for the referenced resource, reflecting CWE-284 (Improper Access Control) and CWE-862 (Missing Authorization)

Why this happens

The root cause is broken or missing authorization logic around the update operation.

Instead of enforcing resource-level checks on every update (for example, verifying record ownership, tenant boundaries, or role-based permissions per object), the code appears to:

  • Accept client-controlled identifiers (such as record IDs) at face value
  • Apply updates based on those identifiers without confirming that the caller is permitted to modify that specific record

This pattern maps directly to CWE-284: Improper Access Control and CWE-862: Missing Authorization, where the system authenticates a user (or sometimes not even that) but fails to perform strict, context-aware authorization checks on sensitive actions.

Potential impact

  • Attackers could modify other users' records, including profile details, configuration, or business data
  • Business-critical data (orders, financial records, workflow states, approvals) can be tampered with or corrupted
  • Privilege escalation via altering role, group, or permission-related fields where exposed through the update path
  • Disruption of business processes through unauthorized status changes or data manipulation
  • Compliance and audit failures due to untraceable or unauthorized changes to regulated data

General mitigation guidance

Effective mitigation focuses on enforcing robust, server-side authorization for every update operation:

  • Apply resource-level authorization checks that confirm the caller's rights to the specific record being updated (e.g., ownership, tenant/organization membership, or explicit permission).
  • Use centralized access control policies (annotations, interceptors, or middleware) that consistently guard all modification endpoints instead of relying on ad hoc checks.
  • Prefer server-derived identifiers and context (such as user ID, tenant ID, department) over trusting client-supplied scope controls; derive filters from the authenticated session rather than request parameters where possible.
  • Implement least-privilege roles and granular permissions so that update capabilities are scoped to only what each role genuinely needs.
  • Harden validation around sensitive fields (roles, ownership, status flags) so that only explicitly authorized flows can change them.

How teams detect issues like this

Organizations can identify this class of issue through a combination of testing and review:

  • Code review: Look for update handlers that:
  • Accept arbitrary IDs or scope parameters from the client
  • Do not call a common authorization component or check ownership/tenant constraints
  • Bypass or omit standard permission annotations or access filters
  • Static analysis: Configure rules to flag:
  • Controller/service methods that modify data but lack authorization annotations
  • Direct repository/DAO update calls that are not wrapped with access checks
  • Security testing: Use role-based and tenant-based test accounts to:
  • Attempt modifying records belonging to other users or tenants
  • Try changing sensitive attributes (roles, status, ownership) via crafted requests
  • Logging and monitoring: Enable detailed audit logging for update endpoints, then monitor for:
  • Cross-tenant or cross-user modifications
  • Updates performed by roles that should have read-only access

Sources

SourceLink
gist.github.comgist.github.com/old6ma/1a2dada02656ba9a4730c85f6c765f4f
gitee.comgitee.com/y_project/RuoYi
gitee.comgitee.com/y_project/RuoYi/issues/IDIDK2
github.comgithub.com/yangzongzhuan/RuoYi

Frequently asked

questions

Exploitability depends on how the RuoYi instance is deployed. If the update endpoint is reachable to general users or from the internet, a large portion of authenticated users—or in misconfigured cases, unauthenticated callers—may be able to tamper with data outside their scope.

Not typically. This class of issue is often exploitable by low-privileged or ordinary users who can access the update functionality. The weakness lies in missing or incorrect authorization around which records may be modified, not in the initial authentication step.

The strongest fix is to enforce strict, server-side authorization checks on every update, ensuring that the requested record belongs to the caller's allowed scope (e.g., same user, department, or tenant) and that their role explicitly permits the modification of that record and those fields.

Prevention typically involves adopting a consistent access control strategy: centralize authorization checks, require resource-level validation in all modifying operations, avoid trusting client-supplied scope parameters, and include access control verification as a standard part of code review, automated testing, and security testing practices.

Find out what's already
exploitable in your codebase.