Impact
SQLAdmin is a flexible Admin interface for SQLAlchemy models. Prior to 0.27.1, ModelView.sort_query in sqladmin/models.py accepts the attacker‑controlled sortBy list‑view query parameter without enforcing the configured column_sortable_list server‑side allow‑list in self._sort_fields. The value is resolved with getattr and passed to relationship joins and order_by, allowing requests to sort by columns hidden from column_list and by related‑model columns through dotted paths. The resulting row order forms an information‑exposure oracle for unexposed values, and reversing ascending and descending order confirms their relative ordering. Pairing sortBy with searchable or filterable columns and pagination can narrow the oracle toward specific values, but exact recovery depends on the application’s available fields and data.
Affected Systems
Deployments of smithyhq SQLAdmin version 0.27.0 or earlier (i.e., any release prior to 0.27.1) are affected. Instances that use ModelView with the default sorting logic and rely on the framework's column_sortable_list configuration are vulnerable. The issue was resolved in the 0.27.1 release and subsequent versions.
Risk and Exploitability
The vulnerability is rated moderate with a CVSS score of 5.3, indicating that exploitation is feasible without privileged access. The EPSS score of 0.00378 (<1%) suggests a very low but nonzero likelihood of exploitation, and the flaw is not listed in CISA's KEV catalog. Based on the description, it is inferred that attackers could remotely exploit the flaw over HTTP by crafting sortBy parameters in browser or API requests that target the admin interface. The vulnerability does not grant code execution or privilege escalation but can expose sensitive database values that may be leveraged in further attacks.
OpenCVE Enrichment
Github GHSA