PyPI: ckan

CVE-2026-42031

Safety vulnerability ID: SFTY-20260429-98550

Safety legacy ID: pyup.io-95308

Affected versions of the ckan package are vulnerable to SQL Injection and Authorization Bypass due to insufficient query validation and access control in the datastore_search_sql action. The datastore_search_sql endpoint accepts user-supplied SQL fragments and executes them against the DataStore PostgreSQL backend, allowing crafted statements to bypass the access checks intended to scope queries to public resources and to reach PostgreSQL system catalogs. An unauthenticated attacker with the DataStore SQL search enabled can issue malicious SQL queries to read data from private resources and extract PostgreSQL system metadata that should not be exposed.

Created at: Apr 30, 2026Updated at: Apr 30, 2026

Overview

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

Advisory

Affected versions of the ckan package are vulnerable to SQL Injection and Authorization Bypass due to insufficient query validation and access control in the datastore_search_sql action. The datastore_search_sql endpoint accepts user-supplied SQL fragments and executes them against the DataStore PostgreSQL backend, allowing crafted statements to bypass the access checks intended to scope queries to public resources and to reach PostgreSQL system catalogs. An unauthenticated attacker with the DataStore SQL search enabled can issue malicious SQL queries to read data from private resources and extract PostgreSQL system metadata that should not be exposed.

Affected Package

Affecting ckan package, versions
<2.10.10
>=2.11.0,<=2.11.4

Also affects

---

How to Fix

Upgrade
ckan
to
2.10.10
2.11.5
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more