LiveActive security incident?Get immediate response
CVE Record

CVE-2026-33941: Handlebars.js has JavaScript Injection in CLI Precompiler via Unescaped Names and Options

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.

HighCVSS 8.3Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2026-33941 affects the Handlebars.js CLI precompiler. If an attacker can influence template filenames or certain command-line options, they may cause malicious JavaScript to be placed into generated bundles and run later. The issue is high severity, fixed in Handlebars 4.7.9, and most urgent for build pipelines processing untrusted templates or packages.

Executive priority

Prioritize remediation for software supply chain and build systems first. The impact can be severe because injected JavaScript may execute in production bundles, but exploitation depends on attacker influence over precompiler inputs.

Technical view

Handlebars.js 4.0.0 through 4.7.8 concatenate user-controlled filenames and CLI options into emitted JavaScript without proper escaping. This creates JavaScript injection in bin/handlebars and lib/precompiler.js. Successful exploitation requires attacker control over precompiler inputs and later execution of the generated bundle in Node.js or a browser.

Likely exposure

Exposure is most likely in CI, packaging, or frontend build workflows that run the Handlebars CLI precompiler on templates from contributors, dependencies, uploads, or generated paths. Applications only using Handlebars runtime rendering are not shown as affected by the provided sources.

Exploitation context

The source bundle does not show CISA KEV listing or confirmed active exploitation. Exploitation requires influence over template filenames or CLI arguments, plus a user or automated system loading the generated JavaScript bundle.

Researcher notes

Focus analysis on precompile paths, not general template rendering unless sources show that path. The CVSS vector indicates local attack, low complexity, low privileges, required user interaction, changed scope, and high confidentiality, integrity, and availability impact.

Mitigation direction

  • Upgrade handlebars to version 4.7.9 or later.
  • Validate filenames and CLI option values before precompilation.
  • Reject values containing JavaScript string-escaping or statement separator characters.
  • Use a fixed trusted namespace from configuration, not user-controlled CLI input.
  • Run precompilation in a sandboxed environment with limited filesystem access.
  • Audit template filenames in repositories and packages consumed by builds.

Validation and detection

  • Inventory projects using handlebars versions 4.0.0 through 4.7.8.
  • Search build scripts and CI jobs for bin/handlebars or precompiler.js usage.
  • Confirm whether template filenames or CLI options can come from untrusted sources.
  • Verify dependency updates resolve to handlebars 4.7.9 or later.
  • Review generated bundles from untrusted inputs for unexpected JavaScript additions.
  • Check Red Hat advisories if relying on vendor-packaged handlebars components.
Prepared
Confidence
high
Sources
10

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-116: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cwe · medium confidence lookup

CWE-79: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cwe · medium confidence lookup

CWE-94: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Container behavior lookup

The affected technology mentions containers, so container-specific ATT&CK technique review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-33941 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.3 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
5Timeline events
2ADP providers
9Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: noTechnical Impact: total

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.3CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H1.56GitHub_M
8.2CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H1.56redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

8.3High
CVSS 3.1 vector shape for CVE-2026-33941Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPhandlebars.js: Handlebars: Arbitrary code execution via CLI precompiler input sanitization flaw
other:Red Hat severity ratingcvssV3_1
  • 2026-03-27T22:02:54.583Z: Reported to Red Hat.
  • 2026-03-27T21:13:15.437Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
handlebars-langhandlebars.js>= 4.0.0, < 4.7.9Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-116 · source CWE mapping

Improper Encoding or Escaping of Output

Improper Encoding or Escaping of Output represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

CWE-79 · source CWE mapping

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

CWE-94 · source CWE mapping

Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.