Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 1.8%top 24%

CVE-2026-33937: CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') in handlebars-lang handlebars.js

0
Critical
VulnerabilityCVE-2026-33937cvecve-2026-33937cwe-843cwe-94
Published: 03/27/2026 (03/27/2026, 21:03:46 UTC)
Source: CVE Database V5
Vendor/Project: handlebars-lang
Product: handlebars.js

Description

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, `Handlebars.compile()` accepts a pre-parsed AST object in addition to a template string. The `value` field of a `NumberLiteral` AST node is emitted directly into the generated JavaScript without quoting or sanitization. An attacker who can supply a crafted AST to `compile()` can therefore inject and execute arbitrary JavaScript, leading to Remote Code Execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. Validate input type before calling `Handlebars.compile()`; ensure the argument is always a `string`, never a plain object or JSON-deserialized value. Use the Handlebars runtime-only build (`handlebars/runtime`) on the server if templates are pre-compiled at build time; `compile()` will be unavailable.

CVSS v3.1

Score 9.8critical

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected software

handlebars
pkg:npm/handlebars
Affected versions
>=4.0.0 <4.7.9

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 13:22:00 UTC

Technical Analysis

Handlebars.js versions 4.0.0 through 4.7.8 have a type confusion vulnerability (CWE-843) where the compile() function accepts a pre-parsed AST object. The value field of a NumberLiteral AST node is emitted directly into generated JavaScript code without quoting or sanitization, enabling an attacker with the ability to supply a crafted AST to perform remote code execution on the server. This vulnerability is tracked as CVE-2026-33937 and has a CVSS 3.1 score of 9.8 (critical). The issue is resolved in version 4.7.9. Mitigations include validating that the input to compile() is always a string and never a plain object, or using the runtime-only build on the server side to avoid using compile().

Potential Impact

Successful exploitation allows an unauthenticated attacker who can supply a crafted AST object to Handlebars.compile() to execute arbitrary JavaScript code remotely on the server, leading to full compromise of the server environment. The vulnerability affects confidentiality, integrity, and availability with a critical severity rating (CVSS 9.8).

Mitigation Recommendations

An official fix is available in Handlebars.js version 4.7.9. Users should upgrade to this version to remediate the vulnerability. Until upgrading, mitigate by validating input types before calling Handlebars.compile() to ensure the argument is always a string and not a deserialized object. Alternatively, use the Handlebars runtime-only build on the server if templates are pre-compiled at build time, which disables the compile() function and prevents exploitation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-24T19:50:52.103Z
Cvss Version
3.1
State
PUBLISHED
Vendor Advisory Urls
[{"url":"https://access.redhat.com/security/cve/CVE-2026-33937","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:10175","vendor":"Red Hat"}]

Threat ID: 69c6f3473c064ed76ff618a1

Added to database: 03/27/2026, 21:14:47 UTC

Last enriched: 07/15/2026, 13:22:00 UTC

Last updated: 07/31/2026, 19:22:58 UTC

Views: 448

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses