---
id: "CVE-2026-44265"
kind: "vulnerability"
aliases: ["CVE-2026-44265", "GHSA-x9rp-7wh3-2rj5"]
title: "Elo backends have code injection via unvalidated emission of programmatic AST fields"
severity: "high"
cvss: 7.4
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "@enspirit/elo", "fixed": ["1.0.1"], "affected": "<= 1.0.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-20", "cwe-749", "cwe-89", "cwe-94", "elo", "node", "npm", "package", "python", "ruby", "sql"]
not_affected_if: ["parser-only-usage", "trusted-ast-input"]
published_at: "2026-11-03T17:48:09+00:00"
first_seen_at: "2026-11-03T17:52:03+00:00"
updated_at: "2026-11-03T17:53:07+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-x9rp-7wh3-2rj5", "first_seen_at": "2026-11-03T17:52:03+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44265", "first_seen_at": "2026-11-03T18:22:10+00:00"}]
---

# Elo backends have code injection via unvalidated emission of programmatic AST fields

Elo's programmatic AST API interpolates many node field values into generated JavaScript, Ruby, Python and SQL without escaping. An application that builds the AST from untrusted input can have attacker-chosen code or SQL emitted and executed.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:@enspirit/elo affected <= 1.0.0 fixed 1.0.1

## How to check

- Check the installed version of `@enspirit/elo` with `npm ls @enspirit/elo`
- Search your code for places that build Elo AST objects from JSON request bodies, plugin output or other untyped input

## Fix

- `@enspirit/elo` fixed in `1.0.1`; affected versions are `<= 1.0.0`

## Timeline

- 2026-11-03T17:52:03+00:00 ghsa https://github.com/advisories/GHSA-x9rp-7wh3-2rj5
- 2026-11-03T18:22:10+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-44265

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/enspirit/elo/security-advisories/GHSA-x9rp-7wh3-2rj5
- [advisory] Maintainer's advisory: github.com https://github.com/enspirit/elo/security/advisories/GHSA-x9rp-7wh3-2rj5
- [fix] Patch: github.com https://github.com/enspirit/elo/commit/d2a89a8db76a244eb740687524a7e8529b7554b5
- [fix] Patch: github.com https://github.com/enspirit/elo/commit/fb57dd37a2669d9c412454225c5b89a2adba5d93

## From the sources

### 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:

```js
{ 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:**

```js
{ type: 'variable', name: "1; DROP TABLE users; --" }
// emits: 1; DROP TABLE users; --
```

**Ruby `datapath` segment shell-exec:**

```js
{ 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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
