Ash versions 3.31.3 up to (but not including) 3.38.0 deserialize client-supplied keyset pagination cursors unsafely, which lets an unauthenticated attacker execute arbitrary code or inject SQL.
What Is It
CVE-2026-124283 is an untrusted-data deserialization flaw (CWE-502) with a SQL injection path (CWE-89) in the ash Hex package from ash-project. The vulnerable function is Ash.Page.Keyset.filter/4 in lib/ash/page/keyset.ex. It decodes the client-supplied page[:after] or page[:before] cursor from Erlang external term format. It then uses Ash.Expr.expr?/1 to reject decoded expressions, but that check does not examine the fields of a struct.
Each cursor value is cast against the type of its sort field, and that cast accepts structs for the :ci_string, :map, :struct and :term types. So a struct placed in the cursor for such a sort field reaches the data layer. Two outcomes follow:
- Code execution: With AshPostgres, the read passes the struct to
inspect/1. That runs theInspectimplementation of whichever struct module the attacker chose. A chain of struct modules from ecto and db_connection then calls a function named in the cursor, which permits OS command execution. - SQL injection: An
%Ash.Query.Function.Fragment{}placed inside an%Ash.CiString{}value is written into the SQL query as raw text.
Why It Matters
NVD rates the flaw 9.8 CRITICAL (CVSS 3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H): network-reachable, low complexity, and no privileges or user interaction required. The CNA's CVSS 4.0 score is lower, 8.9 HIGH, because it uses a local attack vector and marks attack requirements as present.
The CVE is not listed in the CISA KEV catalog, so KEV does not confirm active exploitation. CISA's SSVC assessment records exploitation status as proof of concept, automatable as no, and technical impact as total.
What's Vulnerable
- Package:
ash(pkg:hex/ash, alsopkg:github/ash-project/ash) - Affected versions: 3.31.3 up to, but not including, 3.38.0
- Git range: from commit
91874dd5435bc0ffebd8a254acfa573b39b74520up to, but not including, commit8da3fe514975ac93682f8377c5439baefaf50bad - NVD CPE:
cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:* - Affected routines:
Ash.Page.Keyset.filter/4,Ash.Expr.expr?/1,Ash.Type.CiString.cast_input/2
The code-execution chain described in the advisory runs through AshPostgres.
Patch Status
The fix is in commit 8da3fe514975ac93682f8377c5439baefaf50bad. Upgrade ash to 3.38.0 or later. Because there is no KEV entry, no CISA required action or due date applies.