CVE-2026-120299: Ash.Type.Keyword casts client input as trusted stored data, bypassing the input validation of its field types
Summary
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.
Ash.Type.Keyword.castinput/2 in lib/ash/type/keyword.ex converts a map input to a keyword list in trymaptokeyword/2, which casts each declared field with Ash.Type.caststored/3. That function is meant for trusted values read back from the data layer, so client input skips the castinput/2 of each field type. applyconstraints/2 casts the result again with castinput/2, but most types accept a value of their own type unchanged. An embedded resource field is built without its create action, so its validations and changes do not run and its non-public attributes can be set. A :function field accepts a capture string such as &Mod.fun/1, and a :term field decodes Erlang external term format.
This issue affects ash: from 3.24.0 before 3.38.1.
Impact
A client that can set a :keyword attribute or argument stores field values that the field type's input casting would reject, such as an embedded resource that skipped its create action and validations.
Configurations
Reachable when a :keyword attribute or argument that accepts client input declares fields, the client sends it as a map (or a JSON string), and one of the field types casts stored values more loosely than input, such as an embedded resource, :function or :term.
Other sources
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.
Ash.Type.Keyword.castinput/2 in lib/ash/type/keyword.ex converts a map input to a keyword list in trymaptokeyword/2, which casts each declared field with Ash.Type.caststored/3. That function is meant for trusted values read back from the data layer, so client input skips the castinput/2 of each field type. applyconstraints/2 casts the result again with castinput/2, but most types accept a value of their own type unchanged. An embedded resource field is built without its create action, so its validations and changes do not run and its non-public attributes can be set. A :function field accepts a capture string such as &Mod.fun/1, and a :term field decodes Erlang external term format.
This issue affects ash: from 3.24.0 before 3.38.1.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
erlang/ashto a version that resolves this vulnerability.Fixed in 3.38.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.38.1
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using ash versions from 3.24.0 before 3.38.1 are affected when client-controlled map input is accepted for a :keyword attribute or argument. The impact is especially significant when declared keyword fields include embedded resources, :function fields, or :term fields.
What does an attacker need to provide to exploit the bypass?
An attacker needs to supply map-shaped client input to a :keyword attribute or argument. The map is converted to a keyword list and its declared fields are processed as stored, trusted values rather than through each field type's normal input casting.
What are the most important consequences to investigate?
Embedded resource fields may be built without their create action, allowing validations and changes not to run and non-public attributes to be set. A :function field can accept a capture string such as &Mod.fun/1, while a :term field decodes Erlang external term format.
What should teams do if they are affected?
Upgrade ash to version 3.38.1 or later. Until upgraded, identify endpoints that accept client maps for :keyword attributes or arguments and avoid exposing sensitive embedded-resource, :function, or :term fields through those inputs.