The vulnerability is an SQL injection in the datastore_search_sql action in CKAN's datastore extension. The analysis of the commits between the vulnerable version (2.10.9) and the patched version (2.10.10) reveals two key changes that address the vulnerability.
First, commit 4e2cf5b1450494762addb87e41ce26ac2abcf5b2 patches the is_single_statement function in ckanext/datastore/helpers.py. This function is a security control meant to prevent multiple SQL statements from being executed. The patch adds a check to disallow queries containing \', which indicates that this sequence could be used to bypass the single statement check, thus enabling SQL injection. The is_single_statement function is called by datastore_search_sql to validate its input.
Second, commit 13b1e56d64b9dfd3bc5c9a7eb5c22b632f2cc8a7 removes the ts_rewrite function from the list of allowed functions in the datastore. The commit message explicitly states that this function is not safe and can be used for SQL injection.
Based on this, the primary vulnerable function is datastore_search_sql, which is the action that processes the malicious input. The is_single_statement function is also identified as a vulnerable function because it contained the flawed validation logic that was exploited. During an exploit, both of these functions would likely appear in a runtime profile.