Summary
CVE-2026-77956 is a critical code injection vulnerability in ash_ai, the Elixir library that provides structured outputs, vectorization, and tool calling for Ash Framework applications. The flaw resides in the AshAi.Actions.Prompt module, which evaluates prompt content as an EEx (Embedded Elixir) template, allowing an unauthenticated remote attacker to inject and execute arbitrary Elixir code on the host application. The vulnerability carries a maximum CVSS v3.1-equivalent score of 10.0 (Critical) and requires no authentication or user interaction to exploit.
Technical details
- Root cause:
AshAi.Actions.Promptpasses prompt content throughEEx.eval_string/2without sanitization or escaping before sending it to the LLM. Any prompt that does not return aReqLLM.Contextobject is compiled and executed as Elixir source code. - Trigger conditions: An application that builds AI prompts from strings or functions incorporating user-supplied/request data (rather than constructing a
ReqLLM.Contextobject) is vulnerable. Threesobelow_skipannotations in the code suppressed static-analysis warnings about this pattern rather than mitigating it. - Attack vector: Network — an unauthenticated attacker submits text containing EEx expressions (e.g.,
<%= System.cmd(...) %>) to any HTTP endpoint that forwards user input into an AshAi prompt action. The malicious EEx template is evaluated and executed before any request is even sent to the underlying LLM. - Impact: Full remote code execution in the context of the running application/server process, with complete loss of confidentiality, integrity, and availability.
Affected software
- Package:
ash_ai(ash-project) - Vulnerable versions: >= 0.1.0, < 1.0.0
- Fixed version: 1.0.0
Severity
- CVSS Score: 10.0 (Critical)
- CVSS Vector:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H - CWE: CWE-94 (Improper Control of Generation of Code / Code Injection)
Mitigation and recommended actions
- Immediate: Upgrade
ash_aito version 1.0.0 or later, which removes the unsafeEEx.eval_string/2evaluation of prompt content. - If immediate patching is not possible:
- Construct all AshAi prompts as
ReqLLM.Contextobjects instead of raw strings or functions that assemble content from user-supplied/request data — prompts returningReqLLM.Contextbypass the vulnerable EEx evaluation path. - Audit all AshAi
Actions.Promptusages for any path where request or user-controlled data flows into prompt strings, and remove or sanitize such flows until the upgrade can be applied. - Treat any application using
ash_aiprompt actions with untrusted input as high risk and restrict network exposure until patched.
- Construct all AshAi prompts as

