cve.bz

CVE-2026-33938 handlebarsjs handlebars: Code Injection

8.1 highExploit referenceEPSS 0.7%Fix available

High (8.1) in handlebarsjs handlebars. EPSS 0.7% estimated probability of exploitation activity in the next 30 days. Fixed in handlebars 4.7.9.

On this page
Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, the `@partial-block` special variable is stored in the template data context and is reachable and mutable from within a template via helpers that accept arbitrary objects. When a helper overwrites `@partial-block` with a crafted Handlebars AST, a subsequent invocation of `{{> @partial-block}}` compiles and executes that AST, enabling arbitrary JavaScript execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. First, use the runtime-only build (`require('handlebars/runtime')`). The `compile()` method is absent, eliminating the vulnerable fallback path. Second, audit registered helpers for any that write arbitrary values to context objects. Helpers should treat context data as read-only. Third, avoid registering helpers from third-party packages (such as `handlebars-helpers`) in contexts where templates or context data can be influenced by untrusted input.

Severity

CVSS 3.1

8.1 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
0.7% (unchanged from 0.7% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 55th percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2026-03-31. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-94 Improper Control of Generation of Code (Code Injection)
CWE-843 Access of Resource Using Incompatible Type (Type Confusion)
CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-33938 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-33938?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-33938?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-33938 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Badge for a README or a site

CVE-2026-33938

An image that stays current: it is drawn from the data each time it is fetched (a host that proxies images, as GitHub does, may show its copy for a while). Markdown:

[![CVE-2026-33938](https://cve.bz/cve/badge/CVE-2026-33938.svg)](https://cve.bz/cve/CVE-2026-33938)

HTML:

<a href="https://cve.bz/cve/CVE-2026-33938"><img src="https://cve.bz/cve/badge/CVE-2026-33938.svg" alt="CVE-2026-33938"></a>

Affected

Versions

From the NVD's CPE matches.

ProductAffected
handlebarsjs:handlebarsfrom 4.0.0 before 4.7.9

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-3mfm-83xf-c92rnpmhandlebars>=4.0.0 <4.7.94.7.9

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13node-handlebarsno fix listedDEBIAN-CVE-2026-33938
Debian14node-handlebars3:4.7.9-1DEBIAN-CVE-2026-33938
Ubuntu18.04:LTS, 20.04:LTS, 22.04:LTS and 4 morenode-handlebarsno fix listedUBUNTU-CVE-2026-33938

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

Red Hat

Red Hat rates this Important.

Red Hat's statement

Important: A flaw in Handlebars allows arbitrary code execution when processing untrusted input. This occurs if an attacker can manipulate the `@partial-block` special variable through a helper, leading to the execution of a crafted Abstract Syntax Tree. Red Hat products are affected if they use Handlebars versions 4.0.0 through 4.7.8 in server-side applications where untrusted input can influence template data or context objects. Deployments utilizing the Handlebars runtime-only build are not vulnerable.

Red Hat's mitigation

Applications using Handlebars should implement the runtime-only build (`require('handlebars/runtime')`) to prevent exploitation, as this build lacks the vulnerable `compile()` method. Additionally, review all registered helpers to ensure they do not write arbitrary values to context objects, and avoid using third-party helpers in contexts exposed to untrusted input.

ProductPackageStateAdvisory
Cluster Observability Operator 1.5.3cluster-observability-operator/logging-console-plugin-pf4-rhel9:1782839279Fixed 2026-07-01RHSA-2026:34342
Cluster Observability Operator 1.5.3cluster-observability-operator/logging-console-plugin-pf5-rhel9:1782840539Fixed 2026-07-01RHSA-2026:34342
Cluster Observability Operator 1.5.3cluster-observability-operator/troubleshooting-panel-console-plugin-pf6-rhel9:1782839996Fixed 2026-07-01RHSA-2026:34342
Red Hat OpenShift Dev Spaces 3.27devspaces/code-rhel9:1776744110Fixed 2026-04-23RHSA-2026:10175
Cryostat 4handlebarsNot affected
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch6-rhel9Will not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch-operator-bundleWill not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch-proxy-rhel9Will not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch-rhel9-operatorWill not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/kibana6-rhel8Will not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/logging-curator5-rhel9Will not fix
Red Hat Data Grid 8handlebarsNot affected
Red Hat Developer Hub 1rhdh/rhdh-hub-rhel9Affected
Red Hat Enterprise Linux 10firefoxNot affected
Red Hat Enterprise Linux 10thunderbirdNot affected
Red Hat Enterprise Linux 7firefoxNot affected
Red Hat Enterprise Linux 8389-ds:1.4/389-ds-baseWill not fix
Red Hat Enterprise Linux 8firefoxNot affected
Red Hat Enterprise Linux 8grafanaNot affected
Red Hat Enterprise Linux 8mozjs60Not affected
6 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-33938.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON