# GHSA-7xw9-549r-8jrc: DIRAC: SQL injection and lack of access control in PilotManager service

> Authenticated users can exploit SQL injection and missing access controls in PilotManager to read or modify arbitrary pilot job data.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Jul 2026

## What is GHSA-7xw9-549r-8jrc?

GHSA-7xw9-549r-8jrc is a SQL injection vulnerability in DIRAC, published on 13 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### 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/

## Which versions are affected by GHSA-7xw9-549r-8jrc?

6 open source packages ship an affected version, including DIRAC and dirac.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `DIRAC` | PyPI | From 6 | 8.0.79 |
| `DIRAC` | PyPI | From 8.1.0a1 | 9.0.22 |
| `DIRAC` | PyPI | From 9.1.0 | 9.1.10 |
| `dirac` | PyPI | From 6 | 8.0.79 |
| `dirac` | PyPI | From 8.1.0a1 | 9.0.22 |
| `dirac` | PyPI | From 9.1.0 | 9.1.10 |

## How do I fix GHSA-7xw9-549r-8jrc?

Upgrade DIRAC to a fixed version for your release line: 8.0.79, 9.0.22 or 9.1.10.

## Is GHSA-7xw9-549r-8jrc being exploited?

There is no known exploitation of GHSA-7xw9-549r-8jrc in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7xw9-549r-8jrc and fix it if it is affected.

What it is: GHSA-7xw9-549r-8jrc is a SQL injection vulnerability in DIRAC, published on 13 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-7xw9-549r-8jrc in the wild and no public exploit code.

Affected packages and fixed versions:
- DIRAC (PyPI): affected from 6; fixed in 8.0.79
- DIRAC (PyPI): affected from 8.1.0a1; fixed in 9.0.22
- DIRAC (PyPI): affected from 9.1.0; fixed in 9.1.10
- dirac (PyPI): affected from 6; fixed in 8.0.79
- dirac (PyPI): affected from 8.1.0a1; fixed in 9.0.22
- dirac (PyPI): affected from 9.1.0; fixed in 9.1.10

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-7xw9-549r-8jrc/ (Markdown: https://insights.sbomify.com/GHSA-7xw9-549r-8jrc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7xw9-549r-8jrc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7xw9-549r-8jrc/
Summaries are generated and may contain mistakes; the official description above is the record.
