# GHSA-C2P4-P7Q6-HR2J: Ash bulk destroy accepts private (public?: false) action arguments from user parameters, bypassing the argument access boundary

- Database: GitHub
- Severity: CVSS 5.9 (Medium)
- Published: 2026-09-25
- Modified: 2026-09-25

## Tracked as

- [CVE-2026-93477](https://cve.now/CVE-2026-93477.md): ash mass assignment of private arguments in bulk actions

## Affected versions

- ash (Hex): from 2.17.15, fixed in 3.33.11

## Description

## Summary

Ash does not filter private action arguments (those declared `public?: false`) out of the user-supplied parameter map when it builds the base changeset for a bulk destroy operation. `Ash.Actions.Destroy.Bulk.base_changeset/5` matches every key in the caller-controlled `input` map against all of the action's arguments, including private ones, and sets the matched values on the changeset. Those values are then substituted into `arg(...)` template expressions used by the action's changes and validations. Any actor able to submit parameters to a bulk destroy action that defines a private argument referenced by a template can set that argument to a value of their choosing, overriding data the application intended to control only server-side. This is the same class of weakness as CVE-2026-55736 (GHSA-f4hc-ppw9-4hhw), but on the bulk destroy code path, which the 3.29.3 fix did not touch.

## Root Cause

Private arguments (`public?: false`) are Ash's mechanism for values that only trusted server-side code may set, for example via `Ash.Changeset.set_private_argument/3`. When a changeset is built from an untrusted parameter map, keys that name a private argument must be discarded. CVE-2026-55736 was fixed in v3.29.3 by adding a `public?` check to `get_action_argument/2` and `has_argument?/2` in `lib/ash/changeset/changeset.ex`. The bulk destroy path never calls those functions. Instead, `base_changeset/5` performs its own argument matching that has no `public?` clause, so private arguments are accepted regardless of the `public?` flag.

```elixir
# lib/ash/actions/destroy/bulk.ex (base_changeset/5): matches ANY argument by name
Enum.find(action.arguments, fn arg -> to_string(arg.name) == key end)   # no `public?` filter

# lib/ash/changeset/changeset.ex (get_action_argument/2): the fixed, safe form
Enum.find(action.arguments, &(&1.public? && to_string(&1.name) == name))  # requires `public?`
```

The matched arguments are applied with `Ash.Changeset.set_arguments/2`, which itself matches only by name and enforces no `public?` boundary because it is intended for trusted callers.

## Impact

An attacker who can submit parameters to a bulk destroy action (for example through an application layer such as AshJsonApi, AshGraphql, or a custom controller that forwards request parameters to `Ash.bulk_destroy/4`) can set any private argument of that action to an arbitrary value. The prerequisite is the ability to invoke the destroy action with attacker-controlled parameters, which corresponds to an authenticated user permitted to trigger the action (the same privilege level as CVE-2026-55736). The target action must define a private argument that is referenced by an `arg(...)` template in one of its changes or validations. The demonstrated capability is a complete bypass of the `public?: false` access control on action arguments: the attacker-supplied value is baked into the change options and written to resource attributes. Where a private argument drives authorization, identity, record ownership, or audit metadata (for example `acting_user_id` or an audit note), this is an integrity violation and can plausibly escalate to privilege escalation depending on how the application consumes the private argument. Confidentiality and availability are not directly affected.

## Proof of Concept

```text
Setup: an Ash resource with a bulk-destroyable action that declares a private
argument referenced by an arg() template in a change. No non-default options
are required; assume_casted? is left at its default of false.
```

1. Define a destroy action with a private argument and a change that writes it into an attribute:
   `argument :internal_reason, :string, public?: false` and
   `change set_attribute(:audit_note, arg(:internal_reason))`.
2. Invoke the bulk destroy with a string-keyed parameter map that includes the private argument name:

```elixir
Ash.bulk_destroy(
  MyApp.Resource,
  :archive,
  %{"internal_reason" => "ATTACKER_CONTROLLED"}
)
```

3. Observe that `internal_reason` is present in the base changeset's arguments and is substituted into the `set_attribute(:audit_note, arg(:internal_reason))` change, so `audit_note` is written with the attacker-supplied value.

```text
Expected (secure) behavior: the private argument is stripped, as it is on the
non-bulk for_destroy path after the 3.29.3 fix.
Observed behavior: audit_note is set to "ATTACKER_CONTROLLED"; the private
argument value supplied by the caller is honored.
```

## Attack Chain

1. **Exposure:** A caller with permission to trigger a bulk destroy action reaches `Ash.bulk_destroy/4` with an attacker-controlled parameter map. Bulk destroy is a default, always-available API and requires no non-default options.
2. **Control:** The attacker controls both the keys and values of the `input` map. String keys pass the `to_string(arg.name) == key` comparison, so a key naming a private argument is accepted unchanged.
3. **Path:** `Ash.bulk_destroy/4` forwards `input` to `Ash.Actions.Destroy.Bulk.run/5`, which calls `base_changeset/5`. That function reduces over every input key and matches it against all `action.arguments` with no `public?` filter, then applies the matches with `Ash.Changeset.set_arguments/2`.
4. **Guard:** No guard removes private arguments on this path. `set_arguments/2` matches by name only. `pre_template/4` defers only templates that reference `{:_context, _}`; it does not defer `{:_arg, _}` substitution, so `Ash.Expr.fill_template/2` resolves the attacker value into the change options once, from the tainted base changeset.
5. **Primitive:** The pre-resolved, tainted change options are wrapped as `{:templated, opts}`. During per-record processing, `Ash.Actions.Helpers.templated_opts/6` returns already-templated options verbatim, so the properly filtered per-record changeset arguments are never consulted and cannot override the tainted value.
6. **Result:** The change module (for example `set_attribute`) receives the attacker-controlled value and writes it to the resource, completing a full bypass of the `public?: false` argument boundary.

## Bypass Evidence

The 3.29.3 fix for CVE-2026-55736 (GHSA-f4hc-ppw9-4hhw) modified only `lib/ash/changeset/changeset.ex` (`get_action_argument/2` and `has_argument?/2`). The bulk destroy path does not call either function, so the fix has no effect here; this is a distinct, still-unfixed code path rather than a bypass of the applied fix. The following disproof attempts were made and each failed to break the chain:

- Checked whether `pre_template/4`'s only guard, `template_references_context?/1`, blocks argument substitution: it matches only `{:_context, _}`, not `{:_arg, _}`, so argument templates are resolved from the tainted changeset.
- Checked whether per-record changesets, which are correctly filtered through `cast_params`, override the tainted value: they do not, because `templated_opts/6` short-circuits for `{:templated, _}` options and never consults the per-record arguments.
- Checked whether any function between `set_arguments/2` and templating strips private arguments: none does.
- Checked whether `set_arguments/2` enforces `public?`: it does not; it matches by name only.
- Checked whether Ash authorization catches the injected value: authorization operates at the action and record level, not per argument, and `public?` is a construction-time control, not an authorization check.
- Checked ordering versus `set_private_arguments_for_action`: it runs before `set_arguments/2`, so a legitimately set private argument is overwritten by the attacker value, which strengthens rather than weakens the finding.

The only case in which the chain does not complete is when the targeted change's options also reference `{:_context, _}`, which causes `pre_template/4` to defer resolution; this is a coincidental artifact for a narrow subset of change configurations, not a security control, and an attacker selects a target action whose relevant change does not reference context.

## Affected Versions

- `Ecosystem: erlang (Hex)`
- `Package: ash`
- `Confirmed affected range: >= 3.0.0, <= 3.33.10`
- `Latest release checked: 3.33.10 (Hex registry, published 2026-09-24)`
- `Fix status: not fixed in any released version`

The vulnerable `base_changeset/5` matching pattern is present and identical in every tag available for inspection (v3.33.2 through v3.33.10) and in the latest published Hex release, 3.33.10. The CVE-2026-55736 fix released in v3.29.3 did not modify the bulk destroy module, so releases after 3.29.3 remain affected on this path. The upper bound is confirmed against the latest published artifact. The lower bound `>= 3.0.0` is adopted from the introduction of bulk operations in the 3.x series and from the prior advisory's scoping; the exact introducing release could not be confirmed from the available shallow history, so the lower bound carries reduced confidence while the upper bound and current affectedness are verified.

## Suggested Fix

Enforce the `public?: false` boundary on the bulk paths, matching the invariant already applied to the non-bulk path in `changeset.ex`. The argument-matching predicate in `Ash.Actions.Destroy.Bulk.base_changeset/5` should require `arg.public?` in addition to the name comparison, so that private arguments are discarded when they arrive from an untrusted parameter map (private arguments should continue to be settable through `set_private_argument`/`set_private_arguments_for_action`). The same unfiltered matching pattern exists in `Ash.Actions.Update.Bulk.base_changeset/5`, and the remediation should cover it as well so the update bulk path is not left exploitable. As an interim mitigation without a code change, applications can avoid referencing private arguments through `arg(...)` templates in bulk-destroyable (and bulk-updatable) actions, or sanitize the parameter map to remove private argument names before calling `Ash.bulk_destroy/4`.

Reported by zx (GitHub: @manus-pi).

## References

- https://github.com/ash-project/ash/security/advisories/GHSA-c2p4-p7q6-hr2j

Page: https://cve.now/GHSA-C2P4-P7Q6-HR2J

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