Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
9.8

Handlebars 4.0‑4.7.8 lets attackers run JavaScript

published 10 days ago
Summary

Versions 4.0.0 through 4.7.8 of the Handlebars template library can run code supplied in a specially crafted object, giving an attacker the ability to execute arbitrary JavaScript on the server. This affects Docker hardened images that include Handlebars, such as the JupyterHub, DataHub ingestion, and Superset images. Upgrade to Handlebars 4.7.9 or later, ensure only string templates are passed to compile, and use the runtime‑only build when possible.

What to do

The CVE record does not list a fixed version. Check the vendor's site or the advisory links below - a fix may already be released.

Affected software
Ecosystem VendorProductAffected versions
Docker Hardened Images:Alpine:3.24 docker hardened images jupyterhub-k8s-singleuser-sample-fips All versions
Docker Hardened Images:Debian:13 docker hardened images datahub-ingestion All versions
Docker Hardened Images:Debian:13 docker hardened images jupyterhub-k8s-singleuser-sample-fips All versions
Docker Hardened Images:Debian:13 docker hardened images jupyterhub-k8s-singleuser-sample All versions
Docker Hardened Images:Debian:13 docker hardened images superset All versions
Original advisory text
Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8…
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.
Fix within
Internet-facing 3 days
Internal 60 days
  • Not known to be exploited
  • Can be exploited automatically (estimated)
  • Gives an attacker full control (estimated)
Severity
9.8 Critical
Timeline
Published12 Nov 2026
Updated16 Nov 2026
First seen16 Nov 2026
Sources
Track software like this
Free during beta