Bug 2452524 (CVE-2026-33941) - CVE-2026-33941 handlebars.js: Handlebars: Arbitrary code execution via CLI precompiler input sanitization flaw
Summary: CVE-2026-33941 handlebars.js: Handlebars: Arbitrary code execution via CLI pr...
Keywords:
Status: NEW
Alias: CVE-2026-33941
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2452597 2452600 2452620 2452625 2452630 2452634 2452645 2452649 2452660 2452605 2452639 2452642 2452655 2452658 2452662
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-03-27 22:03 UTC by OSIDB Bzimport
Modified: 2026-03-28 10:13 UTC (History)
27 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-03-27 22:03:18 UTC
Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, 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. Version 4.7.9 fixes the issue. Some workarounds are available. First, validate all CLI inputs before invoking the precompiler. Reject filenames and option values  that contain characters with JavaScript string-escaping significance (`"`, `'`, `;`, etc.). Second, use a fixed, trusted namespace string passed via a configuration file rather than  command-line arguments in automated pipelines. Third, run the precompiler in a sandboxed environment (container with no write access to sensitive  paths) to limit the impact of successful exploitation. Fourth, audit template filenames in any repository or package that is consumed by an automated  build pipeline.


Note You need to log in before you can comment on or make changes to this bug.