CVE-2026-44265: Elo backends have code injection via unvalidated emission of programmatic AST fields
Elo's programmatic AST API (npm `@enspirit/elo` up to 1.0.0) emits node field values into JavaScript, Ruby, Python and SQL without validation. An app that builds the AST from untrusted JSON can be made to run injected code or SQL. Fixed in 1.0.1.
Published Nov 3, 2026 · Analysis Nov 3, 2026
What an attacker can do
Elo's TypeScript types vanish at runtime. The AST node fields accept any value, and each backend's emit stage interpolates it into the generated source with no escaping. The advisory counts at least 23 emission sites across six field categories and four backends.
The affected fields include int_literal and float_literal .value, variable.name, member_access.property, object_literal keys, datapath segments, lambda.params[].name and SQL let binding names. Examples from the report: a numeric literal of (console.log('PWN_INT_JS'),1) runs in emitted JavaScript, a Ruby datapath segment of `a, system(touch /tmp/pwn_dp_ruby) shells out, and a SQL variable.name of 1; DROP TABLE users; --` becomes raw SQL (CWE-89, CWE-94).
The attacker must be able to shape an AST object, which means the integrator builds nodes from JSON input, plugin output or another untyped source. That is why the vector is local with high complexity (7.4). Plain Elo text typed through the parser is a separate problem. The same fix pattern was applied in 0.9.7 on 2026-01-27 for date, datetime and duration literals, and this advisory extends it. Apps that only parse trusted Elo text and never build ASTs from outside data are not exposed.
Who is affected
@enspirit/elo 1.0.0 and earlier, in applications that call the programmatic AST API with values from untrusted sources, such as compileToJavaScript fed from deserialised JSON. Check the installed version:
npm ls @enspirit/eloThen search your code for places where AST nodes are built from request bodies, stored rules or plugin output.
@enspirit/elo
- Ecosystem
- npm
- Affected
- <= 1.0.0
- Fixed in
- 1.0.1
- Check
npm ls @enspirit/elo
How to fix it
Upgrade to @enspirit/elo 1.0.1:
npm install @enspirit/[email protected]The fix adds runtime validation at each backend emit site. The advisory names no workaround. Until then, validate AST node fields yourself, and never pass JSON from users straight into AST construction. Regenerate any code or SQL that the old version produced from untrusted input.
How to tell if you were hit
Review where your application builds Elo AST nodes and log the values of fields such as variable.name and datapath segments. Look for values that contain parentheses, semicolons, backticks, system( or SQL keywords. Check database logs for unexpected statements such as DROP TABLE coming from the service account that runs Elo-generated SQL.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Elo's programmatic AST API accepts arbitrary values in many node fields without runtime type or syntax validation. Each backend's emit stage interpolates those values straight into the generated source with no escape pass. An integrator that populates the AST from JSON-deserialised input, plugin output, or any other untyped source therefore exposes a code-injection primitive that flows through to the emitted JavaScript, Ruby, Python, or SQL.
The same pattern was previously addressed in 0.9.7 (2026-01-27), which patched the date/datetime/duration literal emitters via JSON.stringify() after a report by naoyashiga. This advisory generalises that fix to the remaining AST surface — at least 23 emission sites across six node-field categories and four backends.
Vulnerable sinks
Each row is a category of sinks that share the same shape: TypeScript signature erased at runtime → AST-API consumer passes a crafted value → emit interpolates the value verbatim.
| # | AST field | Affected backends | Resulting injection | | 1 | `int_literal` / `float_literal` `.value` | JS, Ruby, Python, SQL | Arbitrary expression in the emitted numeric position (RCE on JS/Ruby/Python; SQL expression injection) | | 2 | `variable.name` | JS, Ruby, Python, SQL | Identifier-position injection; on SQL, raw SQL injection because undefined identifiers are intentionally emitted as column references | | 3 | `member_access.property` | JS, Ruby, Python, SQL | Property access escaped into expression (RCE) | | 4 | `object_literal` key | JS, Ruby, SQL | Computed-key / extra-property injection (RCE on JS/Ruby; SQL injection) | | 5 | `datapath` segment | JS, Ruby, Python, SQL | Ruby symbol-list injection allows backtick shell exec; SQL string-segment unquoted in single-quote context allows SQL injection | | 6 | `lambda.params[].name` | JS, Ruby, Python | Parameter-list structural injection (RCE) | | 7 | SQL `let` binding `name` | SQL | Identifier injection in `… AS <name>` clause |
Proof of Concept
End-to-end execution was verified at commit 749af7b for representative cases per backend. Examples:
Numeric literal injection (all four backends). Feeding the following AST through compileToJavaScript emits a live console.log on call:
{ type: 'literal', value: "(console.log('PWN_INT_JS'),1)" }
// emits: (function(_) { return (console.log('PWN_INT_JS'),1); })(null);The same AST against Ruby with "(system('touch /tmp/pwn_int_ruby'); 1)" creates the file; Python with "(print('PWN_INT_PY') or 1)" prints the sentinel; SQL emits the raw string into the numeric position.
SQL `variable.name` injection:
{ type: 'variable', name: "1; DROP TABLE users; --" }
// emits: 1; DROP TABLE users; --Ruby `datapath` segment shell-exec:
{ type: 'datapath', segments: ["a, system(`touch /tmp/pwn_dp_ruby`)"] }
// emits: [:a, system(`touch /tmp/pwn_dp_ruby`)]All ten end-to-end cases are automated in the ast-exec.js / ast-exec2.js scripts attached to the original report; each console.log and sentinel file was observed.
Independence from GHSA #2
This finding is independent of GHSA #2 (the .constructor.constructor sandbox escape). That report covers payloads delivered as plain Elo *strings* through the parser; the present advisory covers payloads delivered as AST *objects* through the programmatic API. The two threat models do not overlap: GHSA #2's identifier regex ^[a-zA-Z_][a-zA-Z0-9_]*$ accepts constructor (and is the right behaviour for a parser), while the present advisory adds runtime validation at every backend emit site so that AST-API consumers cannot inject arbitrary text into emitted source.
Credited to ultra-supara.
Questions
- Does CVE-2026-44265 affect plain Elo text?
The advisory says no: it covers payloads delivered as AST objects through the programmatic API, not as strings through the parser. The string-based case is a different advisory.
- Which versions are affected and fixed?
@enspirit/elo up to and including 1.0.0 is affected. Version 1.0.1 is the patched release.
- Why is the score lower than for the other Elo flaws?
The attack vector is local and complexity is high, because the attacker must control AST objects that the integrator builds. A plain string is not enough.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-44266
Elo Ruby backend has Remote Code Execution via unescaped `#{...}` interpolation in emitted string literals and subtype-constraint labels
critical9.8Nov 3, 2026CVE-2026-44267
Elo JavaScript emitter has sandbox escape to arbitrary Node.js / browser code execution via unfiltered `.constructor` member access
critical9.8Nov 3, 2026
