# GHSA-RWMX-99MC-QR2X: Ash.Type.Keyword casts client input as trusted stored data, bypassing the input validation of its field types

- Database: GitHub
- Severity: CVSS 2.1 (Low)
- Published: 2026-11-24
- Modified: 2026-11-24

## Tracked as

- [CVE-2026-120299](https://cve.now/CVE-2026-120299.md): ash remote code execution in keyword type

## Affected versions

- ash (Hex): from 3.24.0, fixed in 3.38.1

## Description

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.cast_input/2` (`lib/ash/type/keyword.ex`) converted a map input to a keyword list in `try_map_to_keyword/2`, which cast each declared field with `Ash.Type.cast_stored/3`. That function is meant for trusted values read back from the data layer, so client input skipped the `cast_input/2` of each field type. `apply_constraints/2` casts the result again with `cast_input/2`, but most types accept a value of their own type unchanged. An embedded resource field was built without its create action, so its validations and changes did not run and its non-public attributes could be set. A `:function` field accepted a capture string such as `&Mod.fun/1`, and a `:term` field decoded Erlang external term format.

### 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`.

### Patches

Fixed in ash 3.38.1.

## References

- https://github.com/ash-project/ash/security/advisories/GHSA-rwmx-99mc-qr2x

Page: https://cve.now/GHSA-RWMX-99MC-QR2X

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
