<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://db.gcve.eu/rss/recent/all/10</id>
  <title>Most recent entries from all</title>
  <updated>2026-09-30T02:49:43.911230+00:00</updated>
  <author>
    <name>Vulnerability-Lookup</name>
    <email>info@gcve.eu</email>
  </author>
  <link href="https://db.gcve.eu" rel="alternate"/>
  <generator uri="https://lkiesow.github.io/python-feedgen" version="1.0.0">python-feedgen</generator>
  <subtitle>Contains only the most 10 recent entries.</subtitle>
  <entry>
    <id>https://db.gcve.eu/vuln/ghsa-2w6w-674q-4c4q</id>
    <title>GHSA-2w6w-674q-4c4q — Handlebars.js has JavaScript Injection via AST Type Confusion</title>
    <updated>2026-09-30T02:49:43.912310+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><strong>Affected:</strong> npm: handlebars</p>
<p>## Summary</p>
<p>`Handlebars.compile()` accepts a pre-parsed AST object in addition to a template string. The `value` field of a `NumberLiteral` AST node is emitted directly into the generated JavaScript without quoting or sanitization. An attacker who can supply a crafted AST to `compile()` can therefore inject and execute arbitrary JavaScript, leading to Remote Code Execution on the server.</p>
<p>## Description</p>
<p>`Handlebars.compile()` accepts either a template string or a pre-parsed AST. When an AST is supplied, the JavaScript code generator in `lib/handlebars/compiler/javascript-compiler.js` emits `NumberLiteral` values verbatim:</p>
<p>```javascript
// Simplified representation of the vulnerable code path:
// NumberLiteral.value is appended to the generated code without escaping
compiledCode += numberLiteralNode.value;
```</p>
<p>Because the value is not wrapped in quotes or otherwise sanitized, passing a string such as `{},{})) + process.getBuiltinModule('child_process').execFileSync('id').toString() //` as the `value` of a `NumberLiteral` causes the generated `eval`-ed code to break out of its intended context and execute arbitrary commands.</p>
<p>Any endpoint that deserializes user-controlled JSON and passes the result directly to `Handlebars.compile()` is exploitable.</p>
<p>## Proof of Concept</p>
<p>Server-side Express application that passes `req.body.text` to `Handlebars.compile()`:</p>
<p>```Javascript
import express from "express";
import Handlebars from "handlebars";</p>
<p>const app = express();
app.use(expr…</p></div>
    </content>
    <link href="https://db.gcve.eu/vuln/ghsa-2w6w-674q-4c4q"/>
  </entry>
</feed>
