# CVE-2026-33937: Handlebars.js has JavaScript Injection via AST Type Confusion

- 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-04
- Aliases: UBUNTU-CVE-2026-33937, DEBIAN-CVE-2026-33937, CGA-22qg-f499-9xx7, CGA-2436-xmmv-x7v7, CGA-2m72-m7r9-mc47, CGA-465q-m8cq-8w49, CGA-5c4c-2p7g-59fm, CGA-73hp-68m9-3r4w, CGA-74r3-28hr-5frx, CGA-8mpp-m43q-44v9, CGA-9737-f465-mvwf, CGA-9mcv-jcwg-p9fm, CGA-cph7-43fm-8p84, CGA-cq79-vg37-gj8x, CGA-hqx7-qwpr-7f35, CGA-hrv7-56mp-29gf, CGA-hwj9-9f3c-j546, CGA-hxgh-xfc8-54m7, CGA-j3jh-4p78-fmpq, CGA-j92g-j9jh-qmmf, CGA-qvvx-55v3-8q8q, CGA-r6c6-5gvr-47g9, CGA-r9ff-rjv7-95xc, CGA-rg7r-5j5m-59qh, GHSA-2w6w-674q-4c4q, CGA-222p-wj37-5v8h, CGA-2q9j-h83g-3cjm, CGA-389p-2m8r-qrqm, CGA-3p46-pxcj-v2hm, CGA-3rh2-mf4r-464x, CGA-3v4p-rwph-xgg2, CGA-3w42-7pwm-xp95, CGA-47h3-jc4j-x4cv, CGA-4j5f-cwc9-9rgh, CGA-4rm6-f344-hhgm, CGA-4rp9-4mg3-588j, CGA-4w88-8878-g22g, CGA-4wrq-x992-g93c, CGA-54qh-rghx-g35f, CGA-58r5-wqxv-9v77, CGA-5mfp-3q9v-m999, CGA-5r9g-9f82-8px8, CGA-5x85-6qm9-vwrr, CGA-6cxh-h988-g384, CGA-6pvm-qgvr-hc2x, CGA-6vrq-9c88-jw6q, CGA-72p2-772x-ghgh, CGA-73f3-gfgv-hm8m, CGA-7592-mh93-7ph3, CGA-76gr-53pq-86xf, CGA-7hpw-2fh9-rvwm, CGA-7vc7-6gh2-jvcg, CGA-7vjm-pxm5-pc7p, CGA-846f-hp4x-h2gc, CGA-88xc-95gf-c9vx, CGA-8j8p-mgxm-gr9r, CGA-8mqj-69jp-w646, CGA-9558-cwqp-4mc2, CGA-982m-v946-gm93, CGA-98cp-5x9h-hgw5, CGA-997c-9g4m-jp25, CGA-9m8v-rc4q-jv2w, CGA-9v3v-v2ww-5jm8, CGA-c39f-pvp8-v3wx, CGA-c52x-75cx-5w5q, CGA-c5qm-523h-5php, CGA-cfmr-pfmv-696g, CGA-ffrj-r24c-7rfq, CGA-fx97-6r2v-9c2f, CGA-g257-29rc-mj3q, CGA-g8cv-jcrm-f8mq, CGA-g9qj-gx9v-g92c, CGA-g9r9-p2fp-57rr, CGA-gh9x-4fx6-jx7m, CGA-gm2q-m9j2-55wc, CGA-gvm7-vc42-6cx2, CGA-gwpm-9mr9-97f4, CGA-h285-7x24-4m98, CGA-h3r4-wvgw-c7h5, CGA-h89p-g463-pq54, CGA-h9cf-qq27-mhhf, CGA-hpfq-5v6h-f642, CGA-hwxh-j3mw-f4c7, CGA-j3jh-4jmj-3598, CGA-j5vh-c76w-36w3, CGA-j7j4-pqrm-8xpm, CGA-jhgm-998c-4q5v, CGA-jpm4-h8hv-5xg2, CGA-jwm3-83v9-845p, CGA-m5v9-6535-5px4, CGA-m7x6-2q93-8wxh, CGA-m8gp-jfr2-4hj4, CGA-m8rm-5mm5-q3fh, CGA-m9cc-c69r-45h3, CGA-mh34-x6f7-9x8m, CGA-mhvr-g383-2q9w, CGA-mjpm-2wjh-99vm, CGA-mw8h-4j6p-p88x, CGA-p4g5-6ccf-h45m, CGA-pwr2-2q6c-g55c, CGA-q32c-vvg4-m9j5, CGA-q3fc-58rc-ph65, CGA-q74h-6q5g-j3r2, CGA-q8qf-48rr-3q7p, CGA-qf3r-vcpm-9w9x, CGA-qgxx-gh9h-frwp, CGA-qhg7-7486-rr28, CGA-qmwx-qfhf-78v7, CGA-qvpx-4f32-8w57, CGA-r2vw-pp7p-q86q, CGA-r92x-qjj7-7x5r, CGA-rm2r-q9hg-c28v, CGA-rmx2-28w2-3xm8, CGA-v2f8-vh3p-7w83, CGA-v43w-7264-73vj, CGA-v4p5-grmp-m9x9, CGA-v5gp-v2q7-q77q, CGA-vv9m-h799-v5vx, CGA-vwvq-7q24-qx95, CGA-w293-98fq-r425, CGA-wj3m-826r-5cm8, CGA-x7qj-fm34-4qvj, CGA-xwf8-h8ch-v99h, CGA-xxx6-6g62-m52c
- Record: https://cvemate.com/vulnerability/CVE-2026-33937 · JSON: https://cvemate.com/vulnerability/CVE-2026-33937/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 2.126%, percentile 82.538%, 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-2w6w-674q-4c4q>
- <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-33937>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2452523>
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33937.json>
- <https://access.redhat.com/errata/RHSA-2026:34342>
- <https://access.redhat.com/errata/RHSA-2026:10175>
- <https://ubuntu.com/security/CVE-2026-33937>
- <https://www.cve.org/CVERecord?id=CVE-2026-33937>
- <https://security-tracker.debian.org/tracker/CVE-2026-33937>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33937.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33937>
- <https://github.com/handlebars-lang/handlebars.js>

---

Data as of 2026-12-05T08:24:27.775Z. 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
