/

CVE-2026-45579

Severity:

CRITICAL RISK

(9.9)

Code Injection (CWE-95) in DIRAC Request Counter API

CVE-2026-45579

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.9)

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

A code injection vulnerability in DIRAC allows an authenticated caller to provide a crafted grouping attribute that is evaluated as Python code. Under affected configurations, successful exploitation may execute operating-system commands with the privileges of the DIRAC service account and compromise the distributed-computing environment.

Affected context

The vulnerability occurs in DIRAC's Request Management System when the web request-counter functionality accepts a caller-controlled grouping attribute. It becomes risky when an unrecognized attribute is resolved dynamically against a Request object and evaluated as Python code, particularly when the service account has access to configuration files, credentials, proxies, or tokens.

Exploit preconditions

  • Attack surface: Request Management System web service and its request-counter endpoint
  • Required access: An authenticated DIRAC account able to invoke the affected functionality
  • Trigger point: Processing of a caller-supplied grouping attribute by getRequestCountersWeb
  • Why exploitation is possible: Unrecognized input is dynamically resolved and evaluated as Python code, allowing access to operating-system functionality
  • Execution context: Commands run with the privileges of the account operating the DIRAC services

Why this happens

The underlying bug is the evaluation of attacker-influenced attribute expressions as executable Python rather than treating them as data. Dynamic resolution against a Request object, combined with insufficient allowlisting and expression evaluation, permits crafted dunder attribute chains to reach sensitive runtime functionality. This behavior maps to CWE-95, Improper Neutralization of Directives in Dynamically Evaluated Code.

Potential impact

  • An attacker may execute operating-system commands as the DIRAC service account.
  • The attacker could read dirac.cfg, database passwords, stored proxies, and access tokens.
  • The DIRAC system and connected distributed-computing resources may be fully compromised.
  • Data, jobs, or service configuration could be altered.
  • Local log evidence may be modified or removed, weakening forensic investigation.

General mitigation guidance

Mitigation generally focuses on removing dynamic code evaluation from request

processing and reducing trust in caller-controlled grouping values.

Common defensive patterns include:

  • Replacing expression evaluation with a fixed allowlist mapping of supported grouping attributes.
  • Treating grouping parameters as inert data and rejecting unknown or malformed values before object access.
  • Avoiding reflective access to dunder attributes and other interpreter internals.
  • Running DIRAC services with least-privilege identities and limiting access to credentials, proxies, and tokens.
  • Isolating service accounts and applying restrictive permissions to configuration and log files.
  • Protecting authenticated web interfaces with narrowly scoped roles and authorization policies.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules targeting eval, dynamic expression evaluators, reflective attribute traversal, and unrestricted dunder access.
  • Code review checks for caller-controlled values passed into interpreters, template engines, or object-resolution helpers.
  • Tests that submit unknown, malformed, and boundary grouping attributes and verify rejection without evaluation.
  • Runtime monitoring for unexpected child processes, command execution, access to credential files, or unusual service-account activity.
  • Policy enforcement requiring explicit allowlists for API parameters that select fields, attributes, or query groupings.
  • Automated security review tools that flag dynamic evaluation and unsafe reflection patterns.

Sources

SourceLink
github.comgithub.com/DIRACGrid/DIRAC/commit/8ec11072f48103d94e8b7cca831e2c7ce304d6c7
github.comgithub.com/DIRACGrid/DIRAC/commit/99f1af88b525e69a77f204aebf7d8df3b6056142
github.comgithub.com/DIRACGrid/DIRAC/commit/a6f75ce5d369254d46ca6f1d39e3f384366fa396
github.comgithub.com/DIRACGrid/DIRAC/releases/tag/v8.0.79
github.comgithub.com/DIRACGrid/DIRAC/releases/tag/v9.0.22
github.comgithub.com/DIRACGrid/DIRAC/releases/tag/v9.1.10
github.comgithub.com/DIRACGrid/DIRAC/security/advisories/GHSA-9jpv-c7p4-997x

Frequently asked

questions

It may be exploitable through the DIRAC web service when the affected request-counter

functionality is network-accessible and the attacker has suitable authenticated

access.

The described attack requires an authenticated caller who can reach and invoke

the affected service operation. The practical scope depends on DIRAC endpoint

exposure and authorization controls.

Remove dynamic Python evaluation from request handling and replace it with a

strict allowlist of supported grouping attributes, rejecting all other values.

Treat API parameters as data, prohibit interpreter and dunder access, apply

least privilege to service accounts, and include static analysis and negative

security tests in the development process.

Find out what's already
exploitable in your codebase.