DIRAC: SQL injection and lack of access control in PilotManager serviceGHSA-7xw9-549r-8jrc
HIGHGHSA-7xw9-549r-8jrc is a high-severity (CVSS 8.5) vulnerability in dirac. A fix is available for dirac — see the affected versions and patch details below.
Real-World Exposure
dirac🐍dirac🐍diracReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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
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/
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | dirac | ≥ 6&&< 8.0.79 | 8.0.79pip install --upgrade 'dirac==8.0.79' |
| 🐍PyPI | dirac | ≥ 8.1.0a1&&< 9.0.22 | 9.0.22pip install --upgrade 'dirac==9.0.22' |
| 🐍PyPI | dirac | ≥ 9.1.0&&< 9.1.10 | 9.1.10pip install --upgrade 'dirac==9.1.10' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for dirac, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update dirac to 8.0.79 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-7xw9-549r-8jrc is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is GHSA-7xw9-549r-8jrc in your dependencies?
Find it across PyPI, including transitive dependencies.