/

CVE-2026-51897

Severity:

CRITICAL RISK

(9.8)

Improper Access Control (CWE-284) in RAGFlow get_dataset

CVE-2026-51897

Deferred

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284

Impact:

Potential arbitrary code or command execution

Severity:

CRITICAL RISK

(9.8)

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

RAGFlow contains an improper access control vulnerability in the evaluation application's get_dataset functionality. Depending on the exposed entry and deployment configuration, an attacker may be able to trigger attacker-controlled code or command execution.

RAGFlow contains an improper access control vulnerability in the evaluation application's get_dataset functionality. Depending on the exposed entry and deployment configuration, an attacker may be able to trigger attacker-controlled code or command execution.

Affected context

The issue occurs in RAGFlow's evaluation application, specifically around the get_dataset functionality. Risk depends on whether the relevant entry is exposed to an attacker and whether authorization checks sufficiently restrict access to dataset-related operations or execution paths.

The issue occurs in RAGFlow's evaluation application, specifically around the get_dataset functionality. Risk depends on whether the relevant entry is exposed to an attacker and whether authorization checks sufficiently restrict access to dataset-related operations or execution paths.

Exploit preconditions

  • Attack surface: The evaluation application's get_dataset entry or a related exposed endpoint
  • Required access: Access to the exposed interface; authentication requirements depend on deployment configuration
  • Trigger point: A request that reaches the vulnerable dataset-handling path
  • Why exploitation is possible: Insufficient authorization enforcement may allow an attacker-controlled operation to reach code or command execution behavior
  • Attack surface: The evaluation application's get_dataset entry or a related exposed endpoint
  • Required access: Access to the exposed interface; authentication requirements depend on deployment configuration
  • Trigger point: A request that reaches the vulnerable dataset-handling path
  • Why exploitation is possible: Insufficient authorization enforcement may allow an attacker-controlled operation to reach code or command execution behavior

Why this happens

The underlying issue is an authorization boundary failure in which access to a sensitive application function is not consistently restricted before attacker-controlled input reaches a consequential execution path. This maps to CWE-284, Improper Access Control, because the application may fail to enforce the intended permissions for a protected operation. The insecure pattern is treating endpoint reachability or partial validation as sufficient authorization.

The underlying issue is an authorization boundary failure in which access to a sensitive application function is not consistently restricted before attacker-controlled input reaches a consequential execution path. This maps to CWE-284, Improper Access Control, because the application may fail to enforce the intended permissions for a protected operation. The insecure pattern is treating endpoint reachability or partial validation as sufficient authorization.

Potential impact

  • An attacker may execute arbitrary code within the affected application context.
  • An attacker could execute operating-system commands with the privileges of the service.
  • The vulnerability may enable unauthorized access to datasets or application resources.
  • A compromised service could be used for lateral movement or data manipulation.
  • An attacker may execute arbitrary code within the affected application context.
  • An attacker could execute operating-system commands with the privileges of the service.
  • The vulnerability may enable unauthorized access to datasets or application resources.
  • A compromised service could be used for lateral movement or data manipulation.

General mitigation guidance

Mitigation generally focuses on enforcing authorization at the server-side function boundary and reducing the ability of request data to influence execution behavior. Common defensive patterns include requiring explicit authentication and narrowly scoped authorization for dataset operations, applying deny-by-default access policies, validating inputs against strict schemas, separating data handling from command execution, and avoiding dynamic evaluation of user-controlled values. Running the service with least privilege, isolating execution components, and limiting filesystem and network permissions can reduce impact if a control is bypassed.

Mitigation generally focuses on enforcing authorization at the server-side function boundary and reducing the ability of request data to influence execution behavior. Common defensive patterns include requiring explicit authentication and narrowly scoped authorization for dataset operations, applying deny-by-default access policies, validating inputs against strict schemas, separating data handling from command execution, and avoiding dynamic evaluation of user-controlled values. Running the service with least privilege, isolating execution components, and limiting filesystem and network permissions can reduce impact if a control is bypassed.

How teams detect issues like this

  • Use static analysis and code review to identify sensitive handlers that lack centralized authorization checks.
  • Search for get_dataset and related evaluation paths where request-controlled values reach subprocess, shell, interpreter, or dynamic execution APIs.
  • Review route registration and middleware configuration for publicly reachable evaluation endpoints.
  • Monitor access logs for unexpected calls, authorization failures, unusual dataset identifiers, and process creation by the application.
  • Enforce policy checks in CI to require authorization annotations or centralized access-control middleware on sensitive routes.
  • Neutral automated code-review tools may help identify missing access checks and dangerous data-to-execution flows.
  • Use static analysis and code review to identify sensitive handlers that lack centralized authorization checks.
  • Search for get_dataset and related evaluation paths where request-controlled values reach subprocess, shell, interpreter, or dynamic execution APIs.
  • Review route registration and middleware configuration for publicly reachable evaluation endpoints.
  • Monitor access logs for unexpected calls, authorization failures, unusual dataset identifiers, and process creation by the application.
  • Enforce policy checks in CI to require authorization annotations or centralized access-control middleware on sensitive routes.
  • Neutral automated code-review tools may help identify missing access checks and dangerous data-to-execution flows.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/7101a09720c120fd4989705aa7c0b894

Frequently asked

questions

It may be remotely exploitable when the affected evaluation entry is exposed through a reachable application interface and the attacker can satisfy any required authentication conditions.

The attacker needs access to the relevant entry. Whether authentication or a particular account role is required depends on deployment exposure and access-control configuration.

Enforce authentication and least-privilege authorization at the get_dataset function boundary, validate all request data, and prevent untrusted values from reaching code or command execution mechanisms.

Use centralized deny-by-default authorization, review every sensitive route for access-control coverage, separate data processing from execution, and continuously test exposed interfaces for unauthorized access.

It may be remotely exploitable when the affected evaluation entry is exposed through a reachable application interface and the attacker can satisfy any required authentication conditions.

The attacker needs access to the relevant entry. Whether authentication or a particular account role is required depends on deployment exposure and access-control configuration.

Enforce authentication and least-privilege authorization at the get_dataset function boundary, validate all request data, and prevent untrusted values from reaching code or command execution mechanisms.

Use centralized deny-by-default authorization, review every sensitive route for access-control coverage, separate data processing from execution, and continuously test exposed interfaces for unauthorized access.

Find out what's already
exploitable in your codebase.