<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://vulnerability.circl.lu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Sat, 03 Oct 2026 12:30:41 +0000</lastBuildDate>
    <item>
      <title>GHSA-xjpj-3mr7-gcpf — Handlebars.js has JavaScript Injection in CLI Precompiler via Unescaped Names and Options</title>
      <link>https://vulnerability.circl.lu/vuln/ghsa-xjpj-3mr7-gcpf</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: handlebars&lt;/p&gt;
&lt;p&gt;## Summary&lt;/p&gt;
&lt;p&gt;The Handlebars CLI precompiler (`bin/handlebars` / `lib/precompiler.js`) concatenates user-controlled strings — template file names and several CLI options — directly into the JavaScript it emits, without any escaping or sanitization. An attacker who can influence template filenames or CLI arguments can inject arbitrary JavaScript that executes when the generated bundle is loaded in Node.js or a browser.&lt;/p&gt;
&lt;p&gt;## Description&lt;/p&gt;
&lt;p&gt;`lib/precompiler.js` generates JavaScript source by string-interpolating several values directly into the output. Four distinct injection points exist:&lt;/p&gt;
&lt;p&gt;### 1. Template name injection&lt;/p&gt;
&lt;p&gt;```javascript
// Vulnerable code pattern
output += &amp;#39;templates[&amp;#34;&amp;#39; + template.name + &amp;#39;&amp;#34;] = template(...)&amp;#39;;
```&lt;/p&gt;
&lt;p&gt;`template.name` is derived from the file system path. A filename containing `&amp;#34;` or `&amp;#39;];` breaks out of the string literal and injects arbitrary JavaScript.&lt;/p&gt;
&lt;p&gt;### 2. Namespace injection (`-n` / `--namespace`)&lt;/p&gt;
&lt;p&gt;```javascript
// Vulnerable code pattern
output += &amp;#39;var templates = &amp;#39; + opts.namespace + &amp;#39; = &amp;#39; + opts.namespace + &amp;#39; || {};&amp;#39;;
```&lt;/p&gt;
&lt;p&gt;`opts.namespace` is emitted as raw JavaScript. Anything after a `;` in the value becomes an additional JavaScript statement.&lt;/p&gt;
&lt;p&gt;### 3. CommonJS path injection (`-c` / `--commonjs`)&lt;/p&gt;
&lt;p&gt;```javascript
// Vulnerable code pattern
output += &amp;#39;var Handlebars = require(&amp;#34;&amp;#39; + opts.commonjs + &amp;#39;&amp;#34;);&amp;#39;;
```&lt;/p&gt;
&lt;p&gt;`opts.commonjs` is interpolated inside double quotes with no escaping, allowing `&amp;#34;` to close the string and inject further code.&lt;/p&gt;
&lt;p&gt;### 4. AM…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: handlebars&lt;/p&gt;
&lt;p&gt;## Summary&lt;/p&gt;
&lt;p&gt;The Handlebars CLI precompiler (`bin/handlebars` / `lib/precompiler.js`) concatenates user-controlled strings — template file names and several CLI options — directly into the JavaScript it emits, without any escaping or sanitization. An attacker who can influence template filenames or CLI arguments can inject arbitrary JavaScript that executes when the generated bundle is loaded in Node.js or a browser.&lt;/p&gt;
&lt;p&gt;## Description&lt;/p&gt;
&lt;p&gt;`lib/precompiler.js` generates JavaScript source by string-interpolating several values directly into the output. Four distinct injection points exist:&lt;/p&gt;
&lt;p&gt;### 1. Template name injection&lt;/p&gt;
&lt;p&gt;```javascript
// Vulnerable code pattern
output += &amp;#39;templates[&amp;#34;&amp;#39; + template.name + &amp;#39;&amp;#34;] = template(...)&amp;#39;;
```&lt;/p&gt;
&lt;p&gt;`template.name` is derived from the file system path. A filename containing `&amp;#34;` or `&amp;#39;];` breaks out of the string literal and injects arbitrary JavaScript.&lt;/p&gt;
&lt;p&gt;### 2. Namespace injection (`-n` / `--namespace`)&lt;/p&gt;
&lt;p&gt;```javascript
// Vulnerable code pattern
output += &amp;#39;var templates = &amp;#39; + opts.namespace + &amp;#39; = &amp;#39; + opts.namespace + &amp;#39; || {};&amp;#39;;
```&lt;/p&gt;
&lt;p&gt;`opts.namespace` is emitted as raw JavaScript. Anything after a `;` in the value becomes an additional JavaScript statement.&lt;/p&gt;
&lt;p&gt;### 3. CommonJS path injection (`-c` / `--commonjs`)&lt;/p&gt;
&lt;p&gt;```javascript
// Vulnerable code pattern
output += &amp;#39;var Handlebars = require(&amp;#34;&amp;#39; + opts.commonjs + &amp;#39;&amp;#34;);&amp;#39;;
```&lt;/p&gt;
&lt;p&gt;`opts.commonjs` is interpolated inside double quotes with no escaping, allowing `&amp;#34;` to close the string and inject further code.&lt;/p&gt;
&lt;p&gt;### 4. AM…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/ghsa-xjpj-3mr7-gcpf</guid>
    </item>
  </channel>
</rss>
