CVE Index中文
L3 · ShartedElixir · Ash · Deserialization · RCE · SQL injectionash-keyset-struct-injection

Ash fixes code execution and SQL injection through unsigned keyset pagination cursors

Ash 3.31.3 through versions before 3.38.0 can accept forged structs in unsigned keyset cursors. With specific sort types and the demonstrated AshPostgres path, this permits code execution or SQL injection. Upgrade to 3.38.0; on 3.37.0+, signing cursors is an interim mitigation.

Disclosed
Nov 24, 2026
Public disclosure date
Severity
CVSS 8.9
1 CVE tracked here
Splash zone
Ash apps accepting client keyset cursors, with no signing secret and struct-accepting sort fields; demonstrated on AshPostgres
elixir
In the wild
Unknown
The advisory provides a PoC; it does not confirm exploitation of Ash deployments.

What happened

Ash disclosed this vulnerability on November 24, 2026. It affects 3.31.3 up to, but not including, 3.38.0. A public proof of concept and possible server-side execution support L3; the advisory does not establish an Ash victim count or confirmed exploitation of Ash applications.

Exposure requires a read action with keyset pagination, a client-controlled after or before cursor, an unset keyset_signing_secret, and a sort field of type :ci_string, :map, :struct or :term. The published demonstrations use AshPostgres. Strict types such as :integer reject the forged struct. Do not turn this configuration-specific finding into a claim that every Elixir or Phoenix app is vulnerable. The CNA reports CVSS 4.0 8.9, with AV:L/AT:P; the application still determines whether an untrusted remote client can reach the vulnerable read.

The old decoder used Erlang term decoding in :safe mode, which blocks functions and new atoms but permits maps that impersonate existing structs. Ash’s expression check did not inspect fields within a non-expression struct. With accepted sort types, a value could reach protocol dispatch during error formatting and invoke a DBConnection stream callback. The code-execution example used Ecto 3.14.3 and db_connection 2.10.2. A separate path wraps Ash.Query.Function.Fragment in Ash.CiString and reaches raw SQL, with the application’s database privileges. Fixing only a downstream callback does not remove that SQL-injection or unsafe-decoding path.

3.38.0 changes unsigned cursors to JSON with embedded type conversion and round-trip checks. Signed Erlang terms remain supported only after signature verification. Existing unsigned cursors must be refreshed, and a keyset page sorted by values without a JSON form, such as tuples in a :term attribute, can raise an error. Configuring a signing secret retains signed-term pagination for those values. On 3.37.0 or later, a strong signing secret is the documented interim control; it also invalidates old unsigned cursors.

This is a distinct application-library advisory from the Hex registry intrusion and the Flop cursor issue. The shared struct/callback technique does not establish that the Hex attacker exploited Ash or Flop deployments.

What’s in the bowl

Forged struct values in keyset cursors

Unsigned client cursors can carry structs past expression and type checks, reaching protocol callbacks or raw SQL. CNA CVSS 4.0 8.9 uses AV:L and AT:P; exposure depends on the application.

Fixed versions

ProductSafe fromNote
Ash >=3.31.3 and <3.38.03.38.0Caller-side decoding fix

Crime-scene timeline

  1. Nov 24, 2026

    Ash publishes its security advisory and 3.38.0

    The GHSA was published at 02:29:39 UTC; the Hex registry records 3.38.0 publication at 02:57:12 UTC. Unsigned cursors switch to JSON; signed terms require verification before decoding.

Who said what

We list each claim and who made it. Primary sources (the vendor, the researcher, the registry) are marked. Where reports disagree, we grade by the worst credible case.