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.
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:HAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- Handlebarsjs Handlebars >= 4.0.0 and < 4.7.9
- Handlebarsjs Handlebars 4.7.9
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run Handlebarsjs Handlebars and which version.
- Update to a patched version listed above, then confirm the new version.
- 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 alertsRelated Coverage
External References
- Patchhttps://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2
- Referencehttps://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9
- Exploithttps://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-2w6w-674q-4c4q
- Referencehttps://access.redhat.com/errata/RHSA-2026:10175
- Referencehttps://access.redhat.com/errata/RHSA-2026:34342
- Vendor Advisoryhttps://access.redhat.com/security/cve/CVE-2026-33937
- Issue Trackinghttps://bugzilla.redhat.com/show_bug.cgi?id=2452523
- Referencehttps://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33937.json
Data last checked: Nov 17, 2026 18:35 UTC