NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-44267: Elo JavaScript emitter has sandbox escape to arbitrary Node.js / browser code execution via unfiltered `.constructor` member access

criticalCVSS 3.1 9.8GHSA-33r5-xmm8-v6x5

The Elo expression language (npm `@enspirit/elo`, up to 1.0.0) compiles `.constructor.constructor` chains into live JavaScript `Function` calls. Anyone who controls an Elo string can run arbitrary code in Node.js or the browser. Upgrade to 1.0.1.

Published Nov 3, 2026 · Analysis Nov 3, 2026

What an attacker can do

Three places in src/ combine to cause the bug. The member_access handler in src/transform.ts allows property access on any, object and array types without filtering names. The JavaScript emitter in src/compilers/javascript.ts writes the property name unescaped into the output. The parser in src/parser.ts treats constructor as an ordinary identifier.

The Elo expression ({}).constructor.constructor('...')() therefore becomes a real Function('...')() call in the emitted code. The report's proof of concept reaches child_process.execSync('id') and prints the user's uid (CWE-94, CWE-693).

The attacker needs only to get a plain string into one of three paths. In the library API, defaultFormats.elo.parse() gives Node.js code execution to any integrator who uses Elo as a rule engine, configuration DSL or form builder. The bin/elo CLI runs the payload, including through -f elo, a flag meant to pass files as data. That is a risk on CI hosts. The elo-lang.org playground runs a payload from a ?code= link with run=1, which the report calls a zero-click XSS against that site.

Anyone who treated Elo as a safe DSL for untrusted input should assume code execution at the privilege of the host process.

Who is affected

npm package @enspirit/elo version 1.0.0 and earlier. Affected paths are defaultFormats.elo.parse(), the bin/elo CLI and any application that compiles untrusted Elo text to JavaScript. Check your tree:

npm ls @enspirit/elo

The report's proof of concept installs the package as elo, so also check for that name.

@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 advisory says one patch to the transform step covers all three entry points. It lists no workaround. Until you upgrade, do not compile or run Elo text from untrusted users, and do not run bin/elo on files you do not control.

How to tell if you were hit

Search stored Elo expressions, rule definitions and request logs for the string constructor, especially .constructor.constructor. On hosts that run Elo, look for unexpected child processes of the Node.js process, such as sh or id. In CI, review jobs that run bin/elo on files from pull requests.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

An unauthenticated attacker who controls a string passed to any Elo JavaScript-emission path — defaultFormats.elo.parse(), the bin/elo CLI, or the live browser playground at elo-lang.org/try — can execute arbitrary code in the host JavaScript runtime. A payload built from the .constructor.constructor chain compiles, without modification, to a live Function invocation in the emitted JavaScript, escaping any sandbox assumption around "Elo is a safe data/DSL language."

Vulnerable sink and root cause

Three interacting sites in src/ produce the bug at commit 749af7b:

  1. `src/transform.ts:144–158` — the member_access handler allows access on types any, object, or array without filtering the property name. This is the only place an integrator could have plugged a denylist.
  2. `src/compilers/javascript.ts:210` — the JS emitter writes ${objectExpr}.${ir.property} verbatim into the output, so any property name that survives the transform step flows unescaped into emitted JavaScript.
  3. `src/parser.ts:163–170, 748–750` — the parser accepts constructor (and other JS meta-property names) as an ordinary identifier, so .constructor clears type-checking without triggering any warning.

Combined, the Elo expression ({}).constructor.constructor('…')() compiles to a live Function('…')() call in the emitted JS, executing in the realm of whichever sink runs the compiled code.

Attack surfaces

All three surfaces share the same root cause (no denylist in transform.ts) and are addressed by the same one-file patch:

| # | Entry point | Threat model |
| 1 | Browser playground — `https://elo-lang.org/try/?code=…&run=1` | **0-click XSS / account takeover** against elo-lang.org. `?run=1` triggers `setTimeout(() => this.run(), 100)` in `playground_controller.ts:531`; the server issues a 301 that preserves `?code=`. Any shared URL that contains a payload compromises the visitor's session on elo-lang.org. |
| 2 | `bin/elo` CLI | **RCE on CI / DevOps hosts.** Both `node bin/elo payload.elo` and `node bin/elo -e "_" -d @payload.elo -f elo` fire. The `-f elo` path is especially severe: the flag exists to pass user-supplied files as *data* into an Elo pipeline. No integrator expects a data-format flag to shell out to `/usr/bin/id`. |
| 3 | Library API — `defaultFormats.elo.parse()` | **Node.js RCE for any downstream integrator** using Elo as a rule engine, configuration DSL, or form builder DSL (the primary documented use cases). |

Proof of Concept

Common payload (works on all three entry points):

({}).constructor.constructor('return this.constructor.constructor(\'return process\')().mainModule.require(\'child_process\').execSync(\'id\').toString()')()

Library API — poc-minimal.js:

// npm install elo
const { defaultFormats } = require('elo');

const payload = "({}).constructor.constructor('return this.constructor.constructor(\\'return process\\')().mainModule.require(\\'child_process\\').execSync(\\'id\\').toString()')()";

console.log(defaultFormats.elo.parse(payload));
// → uid=1000(ultrasupara) gid=1000(ultrasupara) groups=…

CLI — poc-cli.sh:

node bin/elo payload.elo
# uid=1000(ultrasupara)…

node bin/elo -e "_" -d @payload.elo -f elo
# uid=1000(ultrasupara)…

Browser playground — 0-click XSS URL:

https://elo-lang.org/try/?code=%28%7B%7D%29.constructor.constructor%28%27alert%28document.domain%29%27%29%28%29&run=1

Opening this URL causes alert(document.domain) to fire automatically after ~100 ms with no user interaction beyond navigating to the link. The 301 redirect preserves the ?code= parameter intact. End-to-end execution on the live production site was captured in a screen recording attached to the original report.

Independence from GHSA #3 (AST-API injection)

This finding is independent of the Medium-severity AST-API report (GHSA #3). That fix's identifier regex ^[a-zA-Z_][a-zA-Z0-9_]*$ happens to accept constructor, and its threat model requires an attacker-controlled AST *object* rather than a plain string. The current finding requires only a plain Elo string, which is a strictly weaker attacker model.

Credited to ultra-supara.

Questions

Is @enspirit/elo 1.0.0 affected by CVE-2026-44267?

Yes. Versions up to and including 1.0.0 are affected, and 1.0.1 is the patched version listed in the advisory.

Does the attacker need to log in?

No. The CVSS vector shows no privileges and no user interaction. Control of any string that reaches an Elo emission path is enough.

Is the Elo CLI affected too?

Yes. Both node bin/elo payload.elo and the -e with -d @payload.elo -f elo form run the payload, per the proof of concept.

References

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 entries