# CVE-2026-33941: Handlebars.js has JavaScript Injection in CLI Precompiler via Unescaped Names and Options

- Priority: **Prioritise**
- Reason: Public exploit (GitHub, Date unknown)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2026-03-27 · Modified: 2026-09-11
- Aliases: UBUNTU-CVE-2026-33941, DEBIAN-CVE-2026-33941, CGA-2hrm-j276-mfc4, CGA-3qmr-c5x6-f88w, CGA-538p-hqc3-w945, CGA-59c6-gc3v-56hq, CGA-5r96-353v-php3, CGA-64hj-63rw-f6mh, CGA-736m-v828-7qjp, CGA-7mgr-8cg9-476v, CGA-94wp-wxj4-2pf7, CGA-9m5j-86hr-m8gh, CGA-9p2w-3hg5-9cf7, CGA-c4m7-m5gj-gqv7, CGA-cxj5-5588-8jh7, CGA-gp7x-6ppq-grvj, CGA-h72w-fjhj-hg7q, CGA-hrrc-rg6p-jfw5, CGA-j45r-8grv-58h8, CGA-mpqc-g6m3-26r4, CGA-rgwf-pc42-hqjm, CGA-rvcp-h7jg-vc9f, CGA-v427-538r-r27c, CGA-wq8v-56rx-r457, GHSA-xjpj-3mr7-gcpf, CGA-24jw-hhh9-qhh8, CGA-2732-hrgv-9384, CGA-2f84-3j9p-87f8, CGA-2j62-8jvq-74w8, CGA-2pgv-93x6-wgp8, CGA-2vpm-mh5j-fjjc, CGA-2wm8-vcfx-r83r, CGA-2x7h-25qf-mc7p, CGA-37gh-xqq3-g96g, CGA-39c8-g4mp-g665, CGA-39h8-399h-5mg2, CGA-3fm4-wjxc-g3qf, CGA-3h8x-hjc2-9vm2, CGA-3jw9-q37h-vgjv, CGA-3vf3-36cg-76fp, CGA-3w62-8pc8-jc27, CGA-3xj4-5r7g-9rqg, CGA-466g-fxv3-w7mm, CGA-46hw-2p97-972g, CGA-49m9-m77q-jjcq, CGA-4rxp-82xj-grgg, CGA-52pr-hpv7-qq5f, CGA-5gwq-grxf-r4f7, CGA-5mv7-3882-73jc, CGA-5p9f-838j-gmcv, CGA-5phm-w6cp-gvjc, CGA-5pr8-6xgf-558f, CGA-5r2r-487h-g7w8, CGA-5wx6-qp5g-2rg5, CGA-623r-874g-x9m7, CGA-6jrr-hm35-5jjh, CGA-6rc4-qg6g-2ff8, CGA-6rv2-p4f5-hx5g, CGA-6x4q-jrxg-x864, CGA-72rx-72j8-h3h5, CGA-75xw-6m9q-qm4p, CGA-7fvm-5ggv-24fc, CGA-848j-vj9m-fhwr, CGA-879v-r4fv-3p5c, CGA-8jx3-fqhq-fhfv, CGA-8p7w-xpwf-98xp, CGA-8qq9-3x29-wjww, CGA-97hm-7366-xcr4, CGA-9g5h-fp2m-4994, CGA-c5cr-5grv-cq7h, CGA-cm73-c4rv-7vrr, CGA-cr8g-v3f5-7m94, CGA-cvc3-vfr4-pc77, CGA-cw49-x3cm-x56w, CGA-fj6v-ccjf-jf3m, CGA-fxxp-mqxv-v9hv, CGA-g2fq-33wj-5797, CGA-g3gv-4h9h-xr7f, CGA-g4p2-xvqh-hwmv, CGA-gmfq-hcfw-hv2m, CGA-gqwc-g36q-9hv8, CGA-h3mh-g3mg-6r3h, CGA-h3xq-fhcf-cg33, CGA-h928-g8fp-8xjf, CGA-hcvw-fx68-j34x, CGA-hmr2-3m37-h5cr, CGA-hwvq-73qr-6g98, CGA-jfg5-r5g3-88fc, CGA-jgqc-5rvh-xchj, CGA-jp3p-h36p-5jvg, CGA-m53m-vgmp-2423, CGA-m7mr-rwc4-h2gm, CGA-m7wj-xvff-pv8c, CGA-mfhm-vr68-gjmw, CGA-mjqc-qx7p-cc3w, CGA-mr9p-g3rw-x9r7, CGA-p4vm-prc6-r3w2, CGA-p66r-p966-vv9q, CGA-prpv-vw3v-42ph, CGA-px6m-qh7w-wc96, CGA-q794-9wwg-23j8, CGA-q854-rvqm-rhw5, CGA-q92f-f3pg-3vgc, CGA-q9x7-977f-263c, CGA-qg7p-vcj6-6w8g, CGA-qmpw-w33c-54pq, CGA-qw9j-5rmc-m5fm, CGA-r565-wjfr-4fw6, CGA-rrgj-5hp3-2x5j, CGA-v6x4-gxx5-c2f2, CGA-v743-jv56-2qgp, CGA-v7gv-cp4m-9p5h, CGA-vc96-353j-4rg3, CGA-vh86-ggh5-566j, CGA-w453-vc7m-rxm9, CGA-w4qm-v36x-r2x2, CGA-w658-2jq4-8m9h, CGA-wm8f-3772-6924, CGA-wx6f-42x5-67h4, CGA-x389-5fg6-wvv8, CGA-x4mh-gmf2-j4h2, CGA-xfgw-4vfr-57gf, CGA-xw8x-rj83-wx5c, CGA-xxp3-757x-w8gw
- Record: https://cvemate.com/vulnerability/CVE-2026-33941 · JSON: https://cvemate.com/vulnerability/CVE-2026-33941/json

## Description

```text
Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, the Handlebars CLI precompiler (`bin/handlebars` / `lib/precompiler.js`) concatenates user-controlled strings — template file names and several CLI options — directly into the JavaScript it emits, without any escaping or sanitization. An attacker who can influence template filenames or CLI arguments can inject arbitrary JavaScript that executes when the generated bundle is loaded in Node.js or a browser. Version 4.7.9 fixes the issue. Some workarounds are available. First, validate all CLI inputs before invoking the precompiler. Reject filenames and option values  that contain characters with JavaScript string-escaping significance (`"`, `'`, `;`, etc.). Second, use a fixed, trusted namespace string passed via a configuration file rather than  command-line arguments in automated pipelines. Third, run the precompiler in a sandboxed environment (container with no write access to sensitive  paths) to limit the impact of successful exploitation. Fourth, audit template filenames in any repository or package that is consumed by an automated  build pipeline.
```

## Signals

- CVSS: 8.3 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H
- EPSS: 0.332%, percentile 28.41%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected (first 20 of 78)

- chainguard gitlab-rails-ce-18.1 (Chainguard): \< 18.1.6-r14
- chainguard gitlab-rails-ce-18.10 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.11 (Chainguard): \< 18.11.6-r2
- chainguard gitlab-rails-ce-18.5 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.6 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.7 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.8 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-18.9 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-19.0 (Chainguard): \< 19.0.3-r1
- chainguard gitlab-rails-ce-19.1 (Chainguard): \< 19.1.1-r6
- chainguard gitlab-rails-ce-assets-fips-19.4 (Chainguard): \< 19.4.0-r2
- chainguard gitlab-rails-ce-fips-18.1 (Chainguard): \< 18.1.6-r15
- chainguard gitlab-rails-ce-fips-18.10 (Chainguard): \< 18.10.8-r8
- chainguard gitlab-rails-ce-fips-18.11 (Chainguard): \< 18.11.6-r1
- chainguard gitlab-rails-ce-fips-18.5 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.6 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.7 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.8 (Chainguard): All versions (No fix recorded)
- chainguard gitlab-rails-ce-fips-18.9 (Chainguard): \< 18.9.8-r8
- chainguard gitlab-rails-ce-fips-19.0 (Chainguard): \< 19.0.3-r1

## References

- <https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-xjpj-3mr7-gcpf>
- <https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2>
- <https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9>
- <https://access.redhat.com/security/cve/CVE-2026-33941>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2452524>
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33941.json>
- <https://access.redhat.com/errata/RHSA-2026:34342>
- <https://access.redhat.com/errata/RHSA-2026:10175>
- <https://ubuntu.com/security/CVE-2026-33941>
- <https://www.cve.org/CVERecord?id=CVE-2026-33941>
- <https://security-tracker.debian.org/tracker/CVE-2026-33941>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33941.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33941>
- <https://github.com/handlebars-lang/handlebars.js>

---

Data as of 2026-12-05T08:23:54.934Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
