CVE-2026-120299 in ashinfo

Summary

by MITRE • 11/24/2026

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 in lib/ash/type/keyword.ex converts a map input to a keyword list in try_map_to_keyword/2, which casts 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 skips 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 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.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/24/2026

The vulnerability identified in the Ash framework represents a critical failure in input validation logic that allows attackers to bypass type constraints and execute arbitrary code or manipulate internal state through improperly handled keyword attributes. This flaw stems from an architectural inconsistency within how data is cast and validated during resource creation operations, specifically affecting versions of ash ranging from 3.24.0 up to but not including 3.38.1. The core issue resides in the Ash.Type.Keyword.cast_input/2 function located in lib/ash/type/keyword.ex, which attempts to convert map inputs into keyword lists by invoking try_map_to_keyword/2. This internal helper subsequently calls Ash.Type.cast_stored/3 for each declared field type rather than using the standard cast_input/2 method intended for untrusted client input. The design choice to use cast_stored/3 is fundamentally flawed because this function is optimized for processing trusted values retrieved from a data layer, where integrity has already been established by the database or storage backend. By bypassing the initial casting phase that applies type-specific validation and sanitization logic, the framework fails to enforce expected constraints on incoming user-supplied data, creating a direct path for exploitation.

The operational impact of this vulnerability is severe due to the specific behaviors of certain field types within the Ash ecosystem. When an embedded resource field is processed through this flawed pathway, it is constructed without executing its associated create action. This omission means that any validations defined in the creation workflow and changes applied during initialization are completely skipped. Consequently, attackers can set non-public attributes on these embedded resources, effectively bypassing access controls and business logic rules designed to restrict write operations. Furthermore, the vulnerability extends beyond simple data manipulation into remote code execution territory through specific field types such as :function and :term. The :function type accepts capture strings in the format &Mod.fun/1, which can be interpreted by the Erlang runtime if not properly sanitized. Similarly, the :term type decodes Erlang external term formats, a mechanism that is inherently dangerous when processing untrusted input because it allows for the instantiation of arbitrary objects and execution of code within the BEAM virtual machine environment. These capabilities transform what might otherwise appear as a data integrity issue into a critical security breach with potential full system compromise.

From an industry standards perspective, this vulnerability aligns closely with CWE-20 Improper Input Validation, specifically regarding the failure to validate input against expected types and constraints before processing. The exploitation of embedded resource fields to bypass access controls also relates to CWE-862 Missing Authorization, as non-public attributes are set without proper permission checks due to the skipped creation actions. Additionally, the ability to execute arbitrary code via :term or :function field manipulation falls under CWE-94 Improper Control of Generation of Code (Code Injection). In terms of attack patterns, this vulnerability facilitates techniques associated with MITRE ATT&CK T1059 Command and Scripting Interpreter through the abuse of Erlang term decoding and function captures. The lack of proper sanitization allows an attacker to inject payloads that are directly executed by the runtime environment, bypassing standard application-level security controls.

Mitigation strategies must focus on immediate patching and architectural review. Organizations running affected versions of ash should upgrade immediately to version 3.38.1 or later, where this input validation logic has been corrected to ensure that all client inputs pass through appropriate casting functions regardless of the field type. For environments where upgrading is not immediately feasible, temporary mitigations include disabling the use of :function and :term fields in public-facing APIs if they are not strictly necessary for business operations. Developers should also implement strict allow-listing for any dynamic input processing to ensure that only expected data structures are accepted. Regular security audits focusing on how embedded resources handle creation actions can help identify similar patterns where validation steps might be inadvertently skipped during complex object construction processes.

Responsible

EEF

Reservation

11/24/2026

Disclosure

11/24/2026

Moderation

accepted

CPE

ready

EPSS

0.00251

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!