---
id: "GHSA-7xw9-549r-8jrc"
page: "https://infrastack.ai/live/GHSA-7xw9-549r-8jrc"
kind: "vulnerability"
aliases: ["GHSA-7xw9-549r-8jrc"]
title: "DIRAC: SQL injection and lack of access control in PilotManager service"
severity: "high"
cvss: 8.5
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "DIRAC", "fixed": ["8.0.79"], "affected": ">= 6, < 8.0.79", "ecosystem": "pypi"}, {"name": "DIRAC", "fixed": ["9.0.22"], "affected": ">= 8.1.0a1, < 9.0.22", "ecosystem": "pypi"}, {"name": "DIRAC", "fixed": ["9.1.10"], "affected": ">= 9.1.0, < 9.1.10", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-284", "cwe-89", "dirac", "grid-computing", "package", "pypi", "self-hosted"]
not_affected_if: ["service-not-deployed"]
published_at: "2026-07-13T18:38:13+00:00"
first_seen_at: "2026-11-10T19:40:05+00:00"
updated_at: "2026-11-10T20:04:58+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-7xw9-549r-8jrc", "first_seen_at": "2026-11-10T19:40:05+00:00"}]
exploit_sources: []
---

# DIRAC: SQL injection and lack of access control in PilotManager service

Link for people: https://infrastack.ai/live/GHSA-7xw9-549r-8jrc (this .md is for agents)

DIRAC's PilotManager service passes caller-supplied parameters straight into SQL statements without escaping, enabling SQL injection. Its access control only requires authentication, so any logged-in user can manage pilot jobs, including deleting them and reading their output.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:DIRAC affected >= 6, < 8.0.79 fixed 8.0.79
- pypi:DIRAC affected >= 8.1.0a1, < 9.0.22 fixed 9.0.22
- pypi:DIRAC affected >= 9.1.0, < 9.1.10 fixed 9.1.10

## How to check

- Check the installed DIRAC version with `pip show DIRAC`
- Look for a PilotManager service running in your DIRAC deployment and confirm whether it is reachable by non-administrative users

## Fix

- DIRAC `8.0.79` for the 6.x to 8.0.x line
- DIRAC `9.0.22` for the 8.1.x to 9.0.x line
- DIRAC `9.1.10` for the 9.1.x line

## Timeline

- 2026-11-10T19:40:05+00:00 ghsa https://github.com/advisories/GHSA-7xw9-549r-8jrc

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/DIRACGrid/DIRAC/security-advisories/GHSA-7xw9-549r-8jrc
- [advisory] Maintainer's advisory: github.com https://github.com/DIRACGrid/DIRAC/security/advisories/GHSA-7xw9-549r-8jrc
- [fix] Patch: github.com https://github.com/DIRACGrid/DIRAC/commit/8731de576cf96826dbbf505508526ada31efb927
- [fix] Patch: github.com https://github.com/DIRACGrid/DIRAC/commit/f67f754d4eef5bf40a8223dab77cf2591808031f

## From the sources

### Details
A number of the functions in PilotManager pass parameters directly through to the database layer, which then does not do any escaping on the parameters. For example setPilotStatus:
https://github.com/DIRACGrid/DIRAC/blob/1738e7c6d2f31d26f1364255d9d2e87b4896c922/src/DIRAC/WorkloadManagementSystem/Service/PilotManagerHandler.py#L343-L349

https://github.com/DIRACGrid/DIRAC/blob/1738e7c6d2f31d26f1364255d9d2e87b4896c922/src/DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.py#L117

This won't accept multiple statements separated by a semicolon, but a carefully crafted set of parameters containing SQL escapes would likely be able to change or return other database entries.

Further to this, the PilotManager access control is only set to "authenticated"; this allows these functions to be called by any user. This allows any user to manage (e.g. delete, read output of) any pilot pilot job:
https://github.com/DIRACGrid/DIRAC/blob/1738e7c6d2f31d26f1364255d9d2e87b4896c922/src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg#L111-L118

This is fixed by changing the SQL statements to use proper parameter substitution and providing a suitable set of access rules for the exported pilot management functions.

### Patched versions:
https://pypi.org/project/DIRAC/8.0.79/
https://pypi.org/project/DIRAC/9.0.22/
https://pypi.org/project/DIRAC/9.1.10/

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
