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

CVE-2026-44266: Elo Ruby backend has Remote Code Execution via unescaped `#{...}` interpolation in emitted string literals and subtype-constraint labels

criticalCVSS 3.1 9.8GHSA-7w38-ggh5-v542

Elo's Ruby compiler backend (npm `@enspirit/elo` up to 1.0.0) does not escape `#` in the Ruby strings it emits. A crafted Elo string literal or subtype label becomes Ruby that runs attacker code and shell commands when executed. Fixed in 1.0.1.

Published Nov 3, 2026 · Analysis Nov 3, 2026

What an attacker can do

In src/compilers/ruby.ts, two emitters write Elo text into Ruby double-quoted strings. The string-literal emitter (lines 180 to 184) escapes backslash, double quote and control characters but not #. The labelled subtype-constraint branch (lines 405 to 412) wraps the label in p_fail(p, "...") with no escaping at all.

In Ruby, #{...} inside a double-quoted string evaluates an expression, and an expression can use backticks to run a shell command. So the Elo literal 'RES=#{id 2>&1}' compiles to Ruby that returns the output of id when the code runs. A label such as '#{touch /tmp/pwned2}' fires when the constraint fails for a value like -1 (CWE-94, CWE-116).

The same Elo source compiled to JavaScript, Python or SQL is harmless, so teams that audited one target may miss it in Ruby. The attacker needs to get Elo text to a Ruby emission path: bin/eloc -t ruby -x on a CI host, the Ruby step of defaultFormats.elo.parse() in an app that uses Elo as a rule engine or configuration DSL, or the elo-lang.org /try playground with the Ruby target. The report calls the last one a zero-click server-side RCE against that site. The result is shell access as the user running the Ruby code.

Who is affected

npm package @enspirit/elo 1.0.0 and earlier, when you compile Elo to Ruby. JavaScript, Python and SQL output of this particular flaw is benign. Check which version you install and whether your build uses -t ruby:

npm ls @enspirit/elo

Then search your scripts for eloc -t ruby.

@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 lists no workaround. Until you upgrade, do not compile untrusted Elo text to Ruby and do not run the emitted Ruby from untrusted sources. Recompile any Ruby output you generated with the old version, since the injection is baked into the emitted code.

How to tell if you were hit

Search Elo sources and generated .rb files for #{ inside string literals or subtype labels, and for backticks within them. On hosts that run emitted Ruby, look for unexpected child processes and files such as /tmp/pwned from the proof of concept. Review CI logs for eloc -t ruby -x runs on input from outside the team.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Elo's Ruby backend emits attacker-controlled text into Ruby double-quoted strings without escaping the # character. Because # begins Ruby's interpolation sequences — #{expr}, #@ivar, #@@cvar, #$gvar — and any expression wrapped in #{...} may use backticks for shell execution, an Elo program that contains a crafted string literal or a labelled subtype constraint compiles to Ruby that evaluates attacker-chosen Ruby, and through backticks runs attacker-chosen shell commands, at runtime.

The same Elo source compiled to JavaScript, Python, or SQL is benign, so the bug also breaks the cross-target portability guarantee the rest of the compiler honours.

Vulnerable sinks

Two sinks exist in src/compilers/ruby.ts at commit 749af7b:

  1. String-literal emitter — lines 180–184. The emitter escapes backslash, double quote, and control characters, but not #. Any #{...} sequence in an Elo string literal flows straight into the emitted Ruby source.
  1. Labelled subtype-constraint branch — lines 405–412. The error message passed to p_fail(p, "...") is wrapped in a Ruby double-quoted string with no escape pass at all. Because the parser at src/parser.ts:1339–1348 accepts single-quoted Elo strings as constraint labels, a label such as '#{ ` id }'` flows unchanged into the emitted Ruby.

Attack surfaces

All three surfaces share the same root cause (the missing # escape in the Ruby double-quoted-string emission path) and are addressed by the same patch:

| # | Entry point | Threat model |
| 1 | `/try` playground on elo-lang.org (Ruby target) | 0-click server-side RCE against elo-lang.org infrastructure from a shared PoC URL |
| 2 | `bin/eloc -t ruby -x` on a CI or DevOps host | RCE on any host that passes Elo strings through the CLI |
| 3 | Library API — `defaultFormats.elo.parse()` with a Ruby emission step | Ruby 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

String-literal sink:

# poc.elo
'RES=#{`id 2>&1`}'
$ eloc -t ruby -x poc.elo
# emitted Ruby contains:  "RES=#{`id 2>&1`}"
# running it returns the output of id(1).

Replacing ` id 2>&1 with touch /tmp/pwned ` produces a trivially observable filesystem side effect.

Subtype-constraint label sink:

# poc-subtype.elo
let X = Int(i | '#{`touch /tmp/pwned2`}': i > 0) in X(-1)

The predicate fails for -1, causing p_fail(p, "#{...}") to interpolate and execute the backtick command at the Ruby layer.

Both flows are automated in the reproduction script submitted with the original report and were verified against Ruby 3.x.

Root cause

The Ruby-emitter's double-quoted-string escape routine omitted # from its character set, and one emission path (the subtype-constraint label branch) performed no escape pass at all.

Credited to ultra-supara.

Questions

Are the JavaScript and Python targets of Elo affected by CVE-2026-44266?

Not by this flaw. The advisory says the same Elo source compiled to JavaScript, Python or SQL is benign. The # is only special in Ruby double-quoted strings.

Which Elo version fixes it?

Version 1.0.1 of @enspirit/elo. Versions up to and including 1.0.0 are affected.

Why is recompiling needed after the upgrade?

The injected code sits in the emitted Ruby text. Output generated by the old compiler still contains it, so regenerate it with 1.0.1.

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