# CKAN has Unauthenticated SQL Injection and Authorization Bypass in \`datastore_search_sql\`

Advisory record · `GHSA-h7j7-3rx6-xvcg`

- **Identifiers:** `GHSA-h7j7-3rx6-xvcg` · `CVE-2026-42031` · `PYSEC-2026-2417`
- **State:** Confirmed
- **Severity:** CVSS 8.3 High
- **Critical:** No
- **Weakness (CWE):** [CWE-89](https://cwe.mitre.org/data/definitions/89.html) · [CWE-863](https://cwe.mitre.org/data/definitions/863.html)
- **Tags:** [SQL injection](https://agentprime.io/advisories/tag/sql-injection.md) · [Broken access control](https://agentprime.io/advisories/tag/access-control.md)
- **Published:** 29 Apr 2026
- **Updated:** 13 Jul 2026
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 29 Apr 2026, 23:11 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `ckan` (PyPI): affected `<2.10.10 || >=2.11.0, <2.11.5`; fixed in `2.10.10`, `2.11.5`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> CKAN versions before 2.10.10 and from 2.11.0 before 2.11.5 are affected by a flaw in datastore_search_sql. An unauthenticated attacker can inject SQL to read private resources and PostgreSQL system information. Upgrade to CKAN 2.10.10 or 2.11.5. Alternatively, set ckan.datastore.sqlsearch.enabled to false, which is disabled by default.

Written 6 Nov 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 8.3 High, CVSS 4.0: `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N`, from CNA (GitHub_M)

- **CISA KEV:** Not listed.
- **EPSS:** 0.018, the 79th percentile, on 15 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 13 May 2026, 19:17 UTC: [Confirmed by NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-42031)
- 31 Oct 2026, 15:01 UTC: First seen by agentprime
- 31 Oct 2026, 15:01 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-h7j7-3rx6-xvcg)

## Sources

- [GitHub Advisory Database: GHSA-h7j7-3rx6-xvcg](https://github.com/advisories/GHSA-h7j7-3rx6-xvcg)
- [OSV: GHSA-h7j7-3rx6-xvcg](https://osv.dev/vulnerability/GHSA-h7j7-3rx6-xvcg)
- <https://github.com/ckan/ckan/security/advisories/GHSA-h7j7-3rx6-xvcg>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-42031>
- <https://docs.ckan.org/en/2.10/changelog.html#v-2-10-10-2026-04-29>
- <https://docs.ckan.org/en/2.11/changelog.html#v-2-11-5-2026-04-29>
- <https://docs.ckan.org/en/2.11/extensions/plugin-interfaces.html#ckan.plugins.interfaces.IAuthFunctions>
- <https://docs.ckan.org/en/2.11/maintaining/configuration.html#ckan-datastore-sqlsearch-enabled>
- <https://github.com/ckan/ckan>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-h7j7-3rx6-xvcg>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-h7j7-3rx6-xvcg/>. Everything for agents: <https://agentprime.io/llms.txt>.
