Vulnerability
CVE-2026-33938
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.
125 advisories report this vulnerability, across 6 ecosystems.
Advisories in Wolfi
- CGA-2p4h-4q94-xh66
- CGA-3m55-88cw-2gf7
- CGA-43cf-2cjx-9gh5
- CGA-4cph-r7qj-3g43
- CGA-5r6g-52ch-jqc6
- CGA-5w64-gj8m-fmr5
- CGA-6xc4-56wg-v523
- CGA-cmvx-fmwm-ffjr
- CGA-cwxr-6g2p-c787
- CGA-hhxv-7f4r-4gc6
- CGA-hmqp-89xg-j6vj
- CGA-j692-rhqv-78wx
- CGA-j7r8-45c8-wj26
- CGA-j7wh-m8w4-382p
- CGA-mxx9-cj9j-h2g2
- CGA-p23x-hf22-3qv8
- CGA-pq88-5m7c-4x6g
- CGA-qchq-4jx3-gjmc
- CGA-vhcr-5vj2-qfxf
- CGA-wpmx-4cj6-hxg4
References
- https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2
- https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9
- https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-3mfm-83xf-c92r
- https://access.redhat.com/errata/RHSA-2026:10175
- https://access.redhat.com/errata/RHSA-2026:34342
- https://access.redhat.com/security/cve/CVE-2026-33938
- https://bugzilla.redhat.com/show_bug.cgi?id=2452525
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33938.json