CVE Watchtower

CVE-2026-33937Handlebarsjs Handlebars Code Injection

NVDCVSS scored by security-advisories@github.com

Vulnerability Summary

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.
Severity Level
CRITICAL(9.8)
Published Date
Mar 27, 2026
Last Modified
Oct 26, 2026
Exploitation Status
Public exploit available
EPSS Score (30-Day)
1.95%Probability
Root Weakness (CWE)
The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended syntax or behavior.
See the MITRE CWE entry for the full definition of this weakness.
CVSS v3.1 Base Metrics — Score 9.8 (CRITICAL)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh

Affected & Patched Versions

Affected Versions
  • Handlebarsjs Handlebars >= 4.0.0 and < 4.7.9
Patched Versions
  • Handlebarsjs Handlebars 4.7.9

What to do

Prioritize this fix. Exploit code is public, so attacks can follow quickly.

  1. Check whether you run Handlebarsjs Handlebars and which version.
  2. Update to a patched version listed above, then confirm the new version.
  3. Review logs and exposed services for signs of earlier compromise.

Timeline

  • Mar 27, 2026Published
  • Oct 26, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new Handlebarsjs Handlebars CVEsYou are reading CVE-2026-33937. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Nov 17, 2026 18:35 UTC