/

CVE-2025-70986

Severity:

HIGH RISK

(7.5)

Improper Access Control in RuoYi selectDept Department Data

CVE-2025-70986

Analyzed

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284, CWE-862

Impact:

Unauthorized Access to Sensitive Department Data

Severity:

HIGH RISK

(7.5)

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

An improper access control issue in the selectDept function of RuoYi v4.8.2 allows requests to retrieve department data without adequate authorization checks.

Under certain conditions, an unauthenticated or low-privileged attacker can access sensitive department information that should be restricted to authorized users.

Affected context

This vulnerability occurs in RuoYi v4.8.2 within the selectDept functionality responsible for querying department information.

It typically appears in deployments where API endpoints rely on missing or incomplete permission checks, role validations, or ownership constraints for data access.

Systems that expose this endpoint to untrusted networks or rely solely on client-side enforcement are more likely to be affected.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the RuoYi application, particularly the selectDept endpoint or its controller action.
  • Required access: Network access to the application; in some configurations, no valid login or only low-privileged credentials may be required.
  • Trigger point: Sending crafted requests to the selectDept function or related route to query department records.
  • Why exploitation is possible: The endpoint does not consistently verify that the requester has appropriate authorization (role, permission, or ownership) before returning department data, leading to a broken access control condition.

Why this happens

The underlying problem is a missing or incomplete authorization layer on a server-side data retrieval function.

Instead of enforcing permission checks (e.g., verifying roles, privileges, or data ownership) before returning department information, the selectDept logic permits access based solely on the presence of a reachable endpoint.

This aligns with CWE-284 (Improper Access Control) and CWE-862 (Missing Authorization), where the application exposes sensitive operations without verifying that the caller is allowed to perform them.

In abstract terms, the bug pattern is: "server-side business logic assumes callers are authorized instead of enforcing authorization for each sensitive operation."

Potential impact

  • Unauthorized viewing of internal department structures and metadata.
  • Exposure of sensitive department attributes (e.g., names, hierarchy, contact info or internal identifiers).
  • Facilitation of targeted social engineering or phishing attacks using organizational mapping.
  • Support for further attacks (e.g., privilege escalation attempts) by revealing how roles and departments are organized.

General mitigation guidance

Mitigation focuses on enforcing consistent, server-side authorization checks for all sensitive endpoints:

  • Apply fine-grained permission checks to the selectDept function, ensuring that only appropriately authorized roles can access department data.
  • Centralize access control logic to reduce the risk of missing checks on individual endpoints.
  • Implement secure-by-default access policies where endpoints deny access unless explicit permissions are granted.
  • Use role-based or attribute-based access control patterns that tie department data access to well-defined user attributes.
  • Limit returned data fields to the minimum necessary and avoid exposing sensitive attributes by default.

How teams detect issues like this

Potential detection approaches include:

  • Static analysis to find controller actions or service methods that return sensitive data without invoking authorization/permission checks.
  • Code review focused on access control annotations, middleware usage, or security interceptors for all endpoints that handle organizational or user-related data.
  • Automated tests or security regression suites that attempt to access protected endpoints with no authentication or low-privileged accounts.
  • Logging and monitoring for unusual access patterns to department data, especially from unexpected users or unauthenticated sessions.

Sources

SourceLink
gist.github.comgist.github.com/old6ma/779320a98f361c299ca024521cb72db6
gitee.comgitee.com/y_project/RuoYi
gitee.comgitee.com/y_project/RuoYi/issues/IDIDME
github.comgithub.com/yangzongzhuan/RuoYi

Frequently asked

questions

Yes. If the RuoYi application is exposed over a network, an attacker with network connectivity to the service can attempt to invoke the selectDept endpoint and access department data.

Not necessarily. Depending on how the application is configured, the missing or weak authorization checks may allow unauthenticated users or users with minimal privileges to access sensitive department data.

Enforce strict, centralized server-side authorization checks on the selectDept function and similar data-retrieval endpoints, ensuring each request is evaluated against explicit permission and role requirements before any data is returned.

Adopt a security-by-design approach: use standardized access control middleware or annotations for all sensitive endpoints, perform regular access control reviews, and incorporate automated tests and static analysis that verify authorization is enforced consistently.

Find out what's already
exploitable in your codebase.