/

CVE-2026-61667

Severity:

CRITICAL RISK

(9.9)

SQL Injection (CWE-89) in DIRAC Dataset Manager Service

CVE-2026-61667

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89, CWE-95

Impact:

Remote Code Execution and Complete System Compromise

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 critical vulnerability in DIRAC's dataset handling allows an authenticated caller to influence a SQL query used to retrieve dataset metadata. The resulting database-controlled expression is evaluated by Python, which may enable arbitrary command execution with the privileges of the DIRAC service account.

Affected context

The issue occurs in DIRAC deployments where the DataManagementSystem file catalog handler processes caller-controlled dataset values and forwards them to the dataset manager. Risk is present when dataset names are incorporated into SQL statements without parameterization and returned metadata is subsequently evaluated as executable Python code.

Exploit preconditions

  • Attack surface: DIRAC file catalog and dataset management services
  • Required access: An authenticated account able to invoke the affected dataset-checking functionality
  • Trigger point: Processing of the checkDataset request and subsequent metadata evaluation
  • Why exploitation is possible: Caller-controlled input reaches a non-parameterized SQL query, and the returned metadata value can influence Python eval execution

Why this happens

The primary defect is SQL query construction through string interpolation, allowing untrusted dataset input to alter database query behavior. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The vulnerability is compounded by CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code, because database-derived content is passed to Python evaluation rather than being treated strictly as data.

Potential impact

  • An attacker may execute operating-system commands as the DIRAC service account.
  • Sensitive configuration files, database credentials, proxies, and tokens could be exposed.
  • The attacker could fully compromise DIRAC-managed services and associated computing resources.
  • Local logs and other evidence could be altered or removed.
  • Distributed-computing workloads, data, and service integrity could be affected.

General mitigation guidance

Mitigation generally focuses on removing both the SQL injection path and the dynamic evaluation of database-derived values.

Common defensive patterns include:

  • Use parameterized queries or trusted query-builder abstractions for all caller-influenced values.
  • Replace eval with explicit parsing, typed structures, and allowlisted operations.
  • Apply strict schema and format validation at the service boundary.
  • Treat database results as untrusted data, even when they originate from internal tables.
  • Run DIRAC services with least-privilege accounts and restrict access to secrets, proxies, and configuration files.
  • Segment service permissions and protect logs from unauthorized modification.

How teams detect issues like this

High-level detection approaches include:

  • Static analysis for SQL statements built through string concatenation or interpolation.
  • Rules identifying eval or equivalent dynamic execution on request data or database results.
  • Code review checks for missing query parameters, weak input validation, and implicit trust in metadata tables.
  • Runtime monitoring for anomalous dataset queries, unexpected metadata values, and child-process creation by DIRAC services.
  • Policy enforcement requiring parameterized database access and prohibiting dynamic evaluation of external or database-controlled content.
  • Neutral automated security-review tools can help identify these patterns during development and CI.

Sources

SourceLink
github.comgithub.com/DIRACGrid/DIRAC/commit/106f6efb40eb7318473fc09fc48083f1f864460a
github.comgithub.com/DIRACGrid/DIRAC/commit/55ecbd729242ddbe06251b57895873cc468f5a1a
github.comgithub.com/DIRACGrid/DIRAC/commit/5a5def88d65a18c77af9f2900ffb5866d6489d62
github.comgithub.com/DIRACGrid/DIRAC/commit/66cfc8bf1dc13a6d38bf0c5654d5b551d76dce9b
github.comgithub.com/DIRACGrid/DIRAC/commit/6f6fe65f27b6913916ef77a77a09918b94029c0a
github.comgithub.com/DIRACGrid/DIRAC/commit/fabf08a4a403fdd92d3445771528fa54b3ee902f
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-m4m7-4cw8-62j6

Frequently asked

questions

It can be exploitable through a network-accessible DIRAC service when an attacker has authenticated access to the affected dataset-management operation.

The described attack requires valid authentication and permission to submit a request that reaches the vulnerable dataset-checking path. The exact scope depends on deployment authorization controls.

Use parameterized SQL queries and eliminate dynamic evaluation of database-derived values. Strictly validate inputs and represent metadata with typed, non-executable structures.

Combine secure database APIs, allowlisted parsing, least-privilege service accounts, focused static analysis, and monitoring for unusual queries or command execution.

Find out what's already
exploitable in your codebase.