GHSA-X9RP-7WH3-2RJ5

Vulnerability from github – Published: 2026-11-03 17:48 – Updated: 2026-11-03 17:48
VLAI
Summary
Elo backends have code injection via unvalidated emission of programmatic AST fields
Details

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.

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-44265"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-20",
      "CWE-749",
      "CWE-89",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-03T17:48:09Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\n\nElo\u0027s programmatic AST API accepts arbitrary values in many node fields without runtime type or syntax validation. Each backend\u0027s 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.\n\nThe 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 \u2014 at least 23 emission sites across six node-field categories and four backends.\n\n### Vulnerable sinks\n\nEach row is a category of sinks that share the same shape: TypeScript signature erased at runtime \u2192 AST-API consumer passes a crafted value \u2192 emit interpolates the value verbatim.\n\n| # | AST field | Affected backends | Resulting injection |\n|---|---|---|---|\n| 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) |\n| 2 | `variable.name` | JS, Ruby, Python, SQL | Identifier-position injection; on SQL, raw SQL injection because undefined identifiers are intentionally emitted as column references |\n| 3 | `member_access.property` | JS, Ruby, Python, SQL | Property access escaped into expression (RCE) |\n| 4 | `object_literal` key | JS, Ruby, SQL | Computed-key / extra-property injection (RCE on JS/Ruby; SQL injection) |\n| 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 |\n| 6 | `lambda.params[].name` | JS, Ruby, Python | Parameter-list structural injection (RCE) |\n| 7 | SQL `let` binding `name` | SQL | Identifier injection in `\u2026 AS \u003cname\u003e` clause |\n\n### Proof of Concept\n\nEnd-to-end execution was verified at commit `749af7b` for representative cases per backend. Examples:\n\n**Numeric literal injection (all four backends).** Feeding the following AST through `compileToJavaScript` emits a live `console.log` on call:\n\n```js\n{ type: \u0027literal\u0027, value: \"(console.log(\u0027PWN_INT_JS\u0027),1)\" }\n// emits: (function(_) { return (console.log(\u0027PWN_INT_JS\u0027),1); })(null);\n```\n\nThe same AST against Ruby with `\"(system(\u0027touch /tmp/pwn_int_ruby\u0027); 1)\"` creates the file; Python with `\"(print(\u0027PWN_INT_PY\u0027) or 1)\"` prints the sentinel; SQL emits the raw string into the numeric position.\n\n**SQL `variable.name` injection:**\n\n```js\n{ type: \u0027variable\u0027, name: \"1; DROP TABLE users; --\" }\n// emits: 1; DROP TABLE users; --\n```\n\n**Ruby `datapath` segment shell-exec:**\n\n```js\n{ type: \u0027datapath\u0027, segments: [\"a, system(`touch /tmp/pwn_dp_ruby`)\"] }\n// emits: [:a, system(`touch /tmp/pwn_dp_ruby`)]\n```\n\nAll 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.\n\n### Independence from GHSA #2\n\nThis 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\u0027s 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.",
  "id": "GHSA-x9rp-7wh3-2rj5",
  "modified": "2026-11-03T17:48:09Z",
  "published": "2026-11-03T17:48:09Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/enspirit/elo/security/advisories/GHSA-x9rp-7wh3-2rj5"
    },
    {
      "type": "WEB",
      "url": "https://github.com/enspirit/elo/commit/d2a89a8db76a244eb740687524a7e8529b7554b5"
    },
    {
      "type": "WEB",
      "url": "https://github.com/enspirit/elo/commit/fb57dd37a2669d9c412454225c5b89a2adba5d93"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/enspirit/elo"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Elo backends have code injection via unvalidated emission of programmatic AST fields"
}



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.