ash: SQL injection
Severity and exploitation
KEV coverage does not rule out exploitation.
Assessment vector
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:HAssessment vector
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:HSeverity
high8.9CVSS measures technical severity, not the likelihood of an attack.
Known exploitation
Not listed in the checked CISA KEV catalog
Absence from CISA KEV does not rule out attacks.
Public exploit
Exploit reference published
Source-linked evidence; not proof of attacks in the wild or independent validation.
Remediation
Package fixes recorded
Fix versions are recorded for 1 of 1 mapped packages. Check each release branch and any separate product guidance.
What this means
Ash versions from 3.31.3 before 3.38.0 have a Deserialization of Untrusted Data vulnerability, allowing an unauthenticated attacker to execute arbitrary code or inject SQL through a forged keyset pagination cursor. The attacker must have access to the application and be able to supply a keyset cursor.
Summarized by @cf/meta/llama-3.3-70b-instruct-fp8-fast. Verify details against the original sources.Attack conditions
No attack-condition excerpt has been identified here. Review the full source description and references for authentication, network access, and configuration requirements.
Review supporting sources →Affected versions
Check the exact model, release, and any platform requirements against your installation.
ash-project · EEF
ash
1 range
ash-project · EEF
ash
Package identity
pkg:hex/ashExplore ash →Identity supplied by EEF. Version matching requires compatible range evidence.
Compare with this publisher’s ranges. This does not inspect your installation.
affected
3.31.3 → before 3.38.0
semver versions
Other versions: unaffected
Product identifiers (CPE)
cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*ash-project · EEF
ash
1 range
ash-project · EEF
ash
Package identity
pkg:github/ash-project/ashIdentity supplied by EEF. Version matching requires compatible range evidence.
Compare with this publisher’s ranges. This does not inspect your installation.
affected
91874dd5435bc0ffebd8a254acfa573b39b74520 → before 8da3fe514975ac93682f8377c5439baefaf50bad
git versions
Other versions: unaffected
Product identifiers (CPE)
cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*Packages
Compare each installed version with the publisher’s affected ranges. Where a fix is recorded, choose the appropriate release branch and test compatibility before upgrading.
| Affected range | Recorded fix |
|---|---|
| From 3.31.3 before 3.38.0Semantic versions | 3.38.0 |
Version evidence: OSV · EEF-CVE-2026-124283
View original version evidence (35 explicit versions)
Source version evidence
This source records affected versions without identifying a package ecosystem and name. This evidence is not used for package matching.
What to do
Compare your installed product and version with the affected versions above. A matching product name alone does not confirm exposure.
Use the recorded fix for your release branch. Review the publisher’s instructions and test compatibility before upgrading.
On ash 3.37.0 or later, set config :ash, keyset_signing_secret to a long random string. Ash then rejects each cursor that it did not sign, before it decodes the cursor. Cursors issued before the change become invalid.
cve.new guidance unless attributed to a publisher. This page does not inspect your installation.
Public exploit evidence
The sources identify public exploit references. We have not independently tested them; their availability does not establish exploitation in the wild.
ash-project/ash · security/advisories/GHSA-m5v6-3qwf-6w9r ↗Attributed to CISA-ADPOriginal source description
Read the full publisher description
Code execution and SQL injection via struct-wrapped values in a forged keyset pagination cursor in Ash
Summary
Deserialization of Untrusted Data vulnerability in ash-project ash allows an unauthenticated attacker to execute arbitrary code or inject SQL through a forged keyset pagination cursor.
Ash.Page.Keyset.filter/4 in lib/ash/page/keyset.ex decodes the client-supplied page[:after] or page[:before] cursor from Erlang external term format and rejects decoded expressions with Ash.Expr.expr?/1. That check does not examine the fields of a struct. The cast of each value against the type of its sort field accepts structs for the :ci_string, :map, :struct and :term types. A struct in the cursor value for such a sort field therefore reaches the data layer. With AshPostgres, the read passes such a struct to inspect/1, which runs the Inspect implementation of the struct module that the attacker selected. A chain of struct modules from ecto and db_connection then calls a function that the cursor names, which permits OS command execution. An %Ash.Query.Function.Fragment{} inside an %Ash.CiString{} value is written into the SQL query as raw text.
This issue affects ash: from 3.31.3 before 3.38.0.
Details
1. Cursor decoding
A keyset cursor is the Base64 form of :erlang.term_to_binary/1 over the list of sort values of one record. decode_values/3 in lib/ash/page/keyset.ex decodes a client-supplied cursor with Ash.Helpers.non_executable_binary_to_term/2 and [:safe]. This refuses functions and new atoms. It accepts a map with a __struct__ key, so the client selects the struct module of each decoded value. When keyset_signing_secret is unset, Ash does not authenticate the cursor.
2. Expression check
check_no_expression/1 calls Ash.Expr.expr?/1 on the decoded term. Ash.Expr.expr?/1 in lib/ash/expr/expr.ex returns true for expression structs and descends into lists, tuples and maps that are not structs. For a struct that is not an expression it returns false and does not examine the fields. Such a struct passes the check, and so does any value inside it.
3. Type cast
cast_values/3 casts each decoded value with Ash.Type.cast_input/3 against the type of its sort field. Strict types such as :integer reject a struct. Four built-in types accept one. Ash.Type.CiString.cast_input/2 returns any %Ash.CiString{} unchanged, and its string field can hold any term. Ash.Type.Map.cast_input/2 and Ash.Type.Struct.cast_input/2 accept any map, which includes any struct. Ash.Type.Term.cast_input/2 accepts any term.
4. Query construction
do_filters/4 puts the value into the keyset filter as the right side of a comparison with the sort field. In ash_sql, the clause of AshSql.Expr for an %Ash.CiString{} value compiles the string field as a nested expression.
5. Code execution
A value that holds a struct inside a map, or inside a tuple in an %Ash.CiString{}, becomes a query parameter. Parameter encoding fails, and the read passes the value to inspect/1 before Ash.read/2 returns. inspect/1 runs the Inspect implementation of each struct module in the value. An %Ecto.Query.DynamicExpr{} whose binding field holds a %DBConnection.Stream{} makes Inspect call Enum.map/2 on the stream. The Enumerable implementation of DBConnection.Stream calls DBConnection.reduce/3, which applies the :log module, function and arguments from the opts field of the struct. The cursor supplies that field. A function from the OTP standard library that applies a further module, function and argument list makes the call fully attacker-controlled, which includes OS command execution.
6. SQL injection
An %Ash.CiString{} whose string field holds an %Ash.Query.Function.Fragment{} with raw: arguments becomes literal SQL text in the WHERE clause. This works for each of the four types, because each accepts the %Ash.CiString{} struct.
Proof of concept
- Define an AshPostgres resource with a
:ci_stringattribute and a read action withpagination keyset?: true. Leavekeyset_signing_secretunset. - Read one page sorted on the
:ci_stringattribute and decode thekeysetof a record withBase.decode64!/1and:erlang.binary_to_term/1. The term is a list with the%Ash.CiString{}sort value and the primary key. - Build an
%Ecto.Query.DynamicExpr{}whosebindingfield is a%DBConnection.Stream{}. Set thequeryfield of the stream to an atom, and put a:logentry with a module, function and argument list into itsoptsfield. - Replace the first element of the list with an
%Ash.CiString{}whosestringfield is a one-element tuple that holds the struct from step 3. - Encode the list with
:erlang.term_to_binary/1andBase.encode64/1, and pass the result aspage: [after: cursor]to the same read. - The read returns an invalid filter value error. Before it returns, the application calls the function from the
:logentry.
For the SQL injection, use an %Ash.Query.Function.Fragment{} with raw: arguments as the string field in step 4. The read succeeds, and the query contains the raw text in the WHERE clause.
Impact
An unauthenticated client that can supply a keyset cursor selects the struct modules of the decoded values. Through protocol implementations in ecto and db_connection, the client makes the application call a function of its choice, and can execute OS commands with the privileges of the BEAM OS user.
An unauthenticated client that can supply a keyset cursor adds SQL text to the query of the read action. The text runs with the database privileges of the application.
Workarounds
On ash 3.37.0 or later, set config :ash, keyset_signing_secret to a long random string. Ash then rejects each cursor that it did not sign, before it decodes the cursor. Cursors issued before the change become invalid.
Configurations
A read action must declare keyset? true in its pagination block, and the application must pass a client-supplied value as the :after or :before page option. The sort must include a field of type :ci_string, :map, :struct or :term. config :ash, :keyset_signing_secret must be unset, which is the default. Both results were demonstrated with the AshPostgres data layer. The code execution was demonstrated with ecto 3.14.3 and db_connection 2.10.2 loaded.
References
7 sourcesView 1 more references
Inside the record
Evidence available
Describes the evidence in this view, not whether the product is safe.
Original records
CVE-2026-124283View the latest unmodified CVE JSON from the official source. It may be newer than this imported page.
cve.new JSON →Underlying weaknesses
The source’s classification of what caused the vulnerability.
Environment requirements
These conditions apply together as specified by the publisher. A matching product name alone does not establish exposure.
EEF · platform conditions
All conditions must hold
Any condition may hold
Vulnerable product
cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*From (inclusive): 3.31.3
Before: 3.38.0
Applicability preview
[
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*",
"versionEndExcluding": "3.38.0",
"versionStartIncluding": "3.31.3",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
],
"operator": "AND"
}
]Contributing organizations · 2
Assigning organization
Additional data publisher
Timeline
All times UTCAdvisory published
Publication date supplied by the source.
Source updated
Latest modification date supplied by the source.
Last imported by cve.new
Latest catalog import, not the date we first saw this advisory.
What changed
Follow changes- CVE · CVE-2026-124283
Observed 2026-11-24T19:54:50.899Z · upstream updated 2026-11-24T18:19:09.008Z
Prioritization updated
before
[]
after
[ { "source": "CISA-ADP", "type": "SSVC", "role": "CISA Coordinator", "timestamp": "2026-11-24T18:18:42.866795Z", "decisions": [ { "name": "Exploitation", "value": "poc" }, { "name": "Automatable", "value": "no" }, { "name": "Technical Impact", "value": "total" } ] } ]
Large field values are marked as truncated previews. Original source snapshots remain retained.
Showing up to 50 most recent observed changes.
Related advisories
Recent advisories affecting the same package or the same recorded vendor and product. These are separate vulnerabilities, not additional evidence for this advisory.
Ash.Type.Keyword casts client input as trusted stored data, bypassing the input validation of its field types
Improper Input Validation vulnerability in ash-project ash allows an attacker to bypass the input validation of the field types of a :keyword attribute or argument.
Recorded fixes — ash: 3.38.1. Check your release branch.
Exploitation not established
An upsert on the primary key in Ash ignores attribute multitenancy, so one tenant can read, overwrite and take over…
Authorization Bypass Through User-Controlled Key vulnerability in ash-project ash allows a user of one tenant to read, overwrite and take over another tenant's records via an upserting create action.
Recorded fixes — ash: 3.37.2. Check your release branch.
Exploitation not established
Loading a through relationship with a limit of 1 in Ash ignores the through path and returns unrelated destination…
Incorrect Authorization vulnerability in ash-project ash allows a client to read destination records unrelated to the source record through a through relationship.
Recorded fixes — ash: 3.37.1. Check your release branch.
Exploitation not established
Ash.count, Ash.exists and Ash.aggregate skip related resources' read policies in filters and sorts
Incorrect Authorization vulnerability in ash-project ash allows an actor to infer data in related records they cannot read via Ash.count/2, Ash.exists/2 and Ash.aggregate/3.
Recorded fixes — ash: 3.34.6. Check your release branch.
Public exploit reference
Filtering an :atom attribute with unsafe_to_atom? can exhaust the BEAM atom table in Ash
Ash stores :atom-typed attributes as strings and compares them as strings. When such an attribute is referenced in a filter, the comparison value is coerced through Ash.Type.Atom. Because the type defined no coerce/2 callback, coercion fell back to the default (cast_input/2), which calls String.to_atom/1 when the attribute is configured with the unsafe_to_atom?: true constraint.
Recorded fixes — ash: 3.34.3. Check your release branch.
Exploitation not established
Private action arguments can be set by user input on the bulk destroy and bulk update paths in Ash
Improperly Controlled Modification of Dynamically-Determined Object Attributes vulnerability in ash-project ash allows a user to set the value of a private action argument on the bulk destroy and bulk update paths.
Recorded fixes — ash: 3.33.11. Check your release branch.
Public exploit reference