Уязвимость Input Validation в ash-project ash позволяет злоумышленнику обойти проверку типа поля атрибута или аргумента :keyword. Ash.Type.Keyword.cast_input/2 в lib/ash/type/keyword.ex преобразует ввод карты в список ключевых слов в try_map_to_keyword/2, который отображает каждое объявленное поле с помощью Ash.Type.cast_stored/3. Эта функция предназначена для доверенных значений, считываемых из уровня данных, поэтому клиентский ввод пропускает cast_input/2 каждого типа поля. apply_constraints/2 снова отображает результат с cast_input/2, но большинство типов принимают значение своего собственного типа без изменений.
Поле встроенного ресурса строится без его создания, поэтому его проверки и изменения не выполняются, и его непубличные атрибуты могут быть установлены. Поле :function принимает строку захвата, такую как &Mod.fun/1, а поле :term декодирует формат внешних терминов Erlang. Эта проблема затрагивает пепел: от 3.24.0 до 3.38.1.
Показать оригинальное описание (EN)
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.
Характеристики атаки
Последствия
Строка CVSS v4.0