CVE-2026-33941

Handlebars.js has JavaScript Injection in CLI Precompiler via Unescaped Names and Options

HIGH
8.2
CVSS Score
Published: March 27, 2026 at 09:13 PM UTC
Updated: September 4, 2026 at 01:19 PM UTC
5 products affected across 3 vendorsHandlebarsEnterprise LinuxLogging Subsystem for Red Hat OpenShift

Using handlebars.js by handlebars-lang?

Get instant alerts when new vulnerabilities affect handlebars.js - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.2
Exploit prediction
EPSS 0.3%
SSVC
PoC

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.0.0 ≤ v < 4.7.9
Affected range stops below 4.7.9, so it looks safe — our inference, not a vendor statement
v < 4.7.9
Affected range stops below 4.7.9, so it looks safe — our inference, not a vendor statement
All versions
Vendor states this is fixed in 10 (unaffected)
Vendor states this is fixed in 7 (unaffected)
Vendor states this is fixed in 8 (unaffected)
Vendor states this is fixed in 9 (unaffected)

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (8)

x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:10175
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/security/cve/CVE-2026-33941
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://bugzilla.redhat.com/show_bug.cgi?id=2452524
Source: 0b0ca135-0b70-47e7-9f44-1890c2a1c46c
https://access.redhat.com/errata/RHSA-2026:34342

SSVC — Action Prioritization

SSVCPoCNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

8.2HIGHredhat-SADP
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-79CWE-94CWE-116

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card