{"id":"CVE-2026-44265","kind":"vulnerability","aliases":["CVE-2026-44265","GHSA-x9rp-7wh3-2rj5"],"related":[],"title":"Elo backends have code injection via unvalidated emission of programmatic AST fields","description":"### Summary\n\nElo'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.\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 — 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 → AST-API consumer passes a crafted value → 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 `… AS <name>` 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: 'literal', value: \"(console.log('PWN_INT_JS'),1)\" }\n// emits: (function(_) { return (console.log('PWN_INT_JS'),1); })(null);\n```\n\nThe 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.\n\n**SQL `variable.name` injection:**\n\n```js\n{ type: 'variable', name: \"1; DROP TABLE users; --\" }\n// emits: 1; DROP TABLE users; --\n```\n\n**Ruby `datapath` segment shell-exec:**\n\n```js\n{ type: 'datapath', 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'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.","summary":"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.","severity":"high","cvss":7.4,"epss":null,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Check the installed version of `@enspirit/elo` with `npm ls @enspirit/elo`\n- 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`","status":"open","published_at":"2026-11-03T17:48:09+00:00","first_seen_at":"2026-11-03T17:52:03+00:00","triaged_at":"2026-11-03T17:53:07+00:00","updated_at":"2026-11-03T17:53:07+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-03T17:53:07Z","model":"claude-haiku-5-5","output":{"fix":"- `@enspirit/elo` fixed in `1.0.1`; affected versions are `<= 1.0.0`","reach":"unknown","title":"Elo: unvalidated AST fields let attackers inject code into generated output","impact":"high","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["npm","elo","node","ruby","python","sql"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"attacker code runs in generated JavaScript, Ruby or Python, or SQL executes","analyst_note":"","how_to_check":"- Check the installed version of `@enspirit/elo` with `npm ls @enspirit/elo`\n- Search your code for places that build Elo AST objects from JSON request bodies, plugin output or other untyped input\n- unknown whether other check steps are stated by the sources","plain_action":"","needs_analyst":false,"not_affected_if":["parser-only-usage","trusted-ast-input"],"who_is_affected":"Only applications that use Elo's programmatic AST API with values from untyped or untrusted sources, such as JSON-deserialised input or plugin output, are exposed. Applications that only compile Elo expression strings through the parser are not covered by this advisory's cases, though a separate earlier advisory (GHSA #2) concerns the parser path.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000854,"input_tokens":5622,"output_tokens":583,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-01':160C '-20':26B '-2026':14A,22A '-27':161C '-44265':15A,23A '-749':28B '-89':30B '-94':32B '/tmp/pwn_dp_ruby':484C,489C '/tmp/pwn_int_ruby':430C '0.9.7':158C '1':237C,412C,420C,431C,442C,462C,467C '2':260C,519C,526C,564C '2026':159C '23':187C '2rj5':20A '3':284C '4':296C '5':315C '6':344C '7':356C '749af7b':379C '7wh3':19A '9':576C 'a-za-z':568C 'a-za-z0':572C 'accept':85C,577C 'access':291C 'across':190C 'add':591C 'address':156C 'advisori':176C,545C,590C 'affect':233C 'allow':327C,341C 'api':44B,84C,220C,555C,603C 'applic':60B 'arbitrari':86C,247C,607C 'ast':11A,43B,64B,83C,120C,183C,219C,231C,395C,424C,550C,602C 'ast-api':218C,601C 'ast-exec.js':501C 'ast-exec2.js':502C 'attach':504C 'attack':71B 'attacker-chosen':70B 'autom':498C 'backend':2A,99C,198C,234C,384C,391C,596C 'backtick':328C 'behaviour':583C 'bind':359C 'build':62B 'call':403C 'cannot':605C 'case':382C,496C 'categori':195C,205C 'chosen':72B 'claus':366C 'code':4A,73B,137C 'code-inject':136C 'column':282C 'commit':378C 'compiletojavascript':397C 'comput':304C 'computed-key':303C 'concept':369C 'console.log':401C,408C,416C,510C 'constructor':578C 'constructor.constructor':528C 'consum':221C,604C 'context':340C 'cover':533C,546C 'craft':224C 'creat':432C 'cve':13A,21A 'cwe':25B,27B,29B,31B 'datapath':316C,472C,479C 'date/datetime/duration':165C 'deliv':535C,548C 'deserialis':124C 'drop':463C,468C 'elo':1A,33B,40B,80C,538C 'emiss':8A,188C 'emit':76B,101C,145C,226C,251C,280C,398C,413C,447C,466C,485C,597C,610C 'emitt':167C 'end':371C,373C,493C,495C 'end-to-end':370C,492C 'enspirit/elo':24A 'eras':215C 'escap':58B,113C,292C,530C 'everi':595C 'exampl':385C 'exec':330C,476C 'execut':78B,374C 'expos':134C 'express':248C,258C,294C 'extra':307C 'extra-properti':306C 'feed':392C 'field':12A,48B,91C,194C,232C 'file':434C,513C 'find':521C 'fix':179C 'float':240C 'flow':141C 'follow':394C 'four':197C,390C 'function':414C 'generalis':177C 'generat':51B,109C 'ghsa':17A,518C,525C,563C 'ghsa-x9rp-7wh3-2rj5':16A 'identifi':267C,277C,362C,566C 'identifier-posit':266C 'independ':516C,523C 'inject':5A,138C,236C,259C,269C,274C,309C,314C,326C,343C,354C,363C,388C,457C,606C 'input':67B,125C 'int':238C,410C,418C,439C 'integr':116C 'intent':279C 'interpol':45B,103C,227C 'javascript':52B,146C 'js':243C,262C,286C,300C,318C,347C,404C,411C,419C,458C,477C 'js/ruby':312C 'js/ruby/python':256C 'json':123C 'json-deserialis':122C 'json.stringify':169C 'key':299C,305C 'lambda.params':345C 'least':186C 'let':358C 'list':325C,352C 'liter':166C,239C,241C,298C,387C,406C 'live':400C 'mani':46B,89C 'member_access.property':285C 'model':559C 'name':346C,360C,461C 'naoyashiga':174C 'node':34B,47B,90C,193C 'node-field':192C 'npm':35B 'null':421C 'numer':252C,386C,453C 'object':297C,551C 'observ':515C 'origin':507C 'output':127C 'overlap':562C 'packag':36B 'paramet':351C 'parameter-list':350C 'parser':542C,586C 'pass':114C,222C 'patch':163C 'pattern':153C 'payload':534C,547C 'per':383C 'plain':537C 'plugin':126C 'popul':118C 'posit':253C,268C,454C 'present':544C,589C 'previous':155C 'primit':139C 'print':437C,443C 'programmat':10A,42B,82C,554C 'proof':367C 'properti':290C,308C 'pwn':409C,417C,438C 'py':440C 'python':37B,54B,148C,245C,264C,288C,320C,349C,435C 'quot':339C 'raw':272C,449C 'rce':254C,295C,310C,355C 'refer':283C 'regex':567C 'remain':182C 'report':172C,508C,532C 'repres':381C 'result':235C 'return':415C 'right':582C 'row':202C 'rubi':38B,53B,147C,244C,263C,287C,301C,319C,322C,348C,426C,471C 'runtim':93C,217C,592C 'sandbox':529C 'script':503C 'segment':317C,334C,473C,480C 'sentinel':445C,512C 'shape':212C 'share':209C 'shell':329C,475C 'shell-exec':474C 'signatur':214C 'singl':338C 'single-quot':337C 'sink':200C,207C 'site':189C,598C 'six':191C 'sourc':110C,132C,611C 'sql':39B,56B,75B,150C,246C,257C,265C,271C,273C,289C,302C,313C,321C,331C,342C,357C,361C,446C,455C 'stage':102C 'straight':106C 'string':333C,450C,539C 'string-seg':332C 'structur':353C 'summari':79C 'surfac':184C 'symbol':324C 'symbol-list':323C 'syntax':96C 'system':428C,482C,487C 'tabl':464C,469C 'ten':491C 'text':608C 'therefor':133C 'threat':558C 'touch':429C,483C,488C 'two':557C 'type':94C,405C,459C,478C 'typescript':213C 'undefin':276C 'unquot':335C 'untrust':66B 'untyp':131C 'unvalid':7A 'user':465C,470C 'valid':97C,593C 'valu':49B,87C,105C,225C,229C,242C,407C 'variabl':460C 'variable.name':261C,456C 'verbatim':230C 'verifi':376C 'via':6A,168C 'vulner':199C 'without':57B,92C 'x9rp':18A 'z':571C 'z0':575C 'za':570C,574C","nicknames":[],"mitigations":[],"who_affected":"Only applications that use Elo's programmatic AST API with values from untyped or untrusted sources, such as JSON-deserialised input or plugin output, are exposed. Applications that only compile Elo expression strings through the parser are not covered by this advisory's cases, though a separate earlier advisory (GHSA #2) concerns the parser path.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["elo"],"ptokens":["elo","enspirit"],"labels":["cwe20","cwe749","cwe89","cwe94","elo","high","node","npm","package","python","ruby","sql"],"campaign_type":null,"first_public_at":"2026-10-30T17:23:04+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-x9rp-7wh3-2rj5","url":"https://github.com/advisories/GHSA-x9rp-7wh3-2rj5","severity":"high","published_at":"2026-11-03T17:48:09+00:00","modified_at":"2026-11-03T17:48:09+00:00","first_seen_at":"2026-11-03T17:52:03+00:00","fetched_at":"2026-11-03T17:52:03+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-44265","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44265","severity":null,"published_at":"2026-11-03T18:18:02+00:00","modified_at":"2026-11-03T18:18:02+00:00","first_seen_at":"2026-11-03T18:22:10+00:00","fetched_at":"2026-11-03T18:22:11+00:00","note":null}],"documents":[{"id":59472,"url":"https://api.github.com/repos/enspirit/elo/security-advisories/GHSA-x9rp-7wh3-2rj5","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":59473,"url":"https://github.com/enspirit/elo/security/advisories/GHSA-x9rp-7wh3-2rj5","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2026-10-30T17:23:04+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":59471,"url":"https://github.com/enspirit/elo/commit/d2a89a8db76a244eb740687524a7e8529b7554b5","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":59475,"url":"https://github.com/enspirit/elo/commit/fb57dd37a2669d9c412454225c5b89a2adba5d93","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}