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

- Severity: Critical 9.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.03%, higher than 82% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-03-27T18:19:58.000Z
- Modified: 2026-10-26T22:10:00.163Z
- Also known as: GHSA-2w6w-674q-4c4q
- Weaknesses: CWE-94, CWE-843
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- handlebars-lang handlebars.js: >= 4.0.0, < 4.7.9
- cluster-observability-operator/logging-console-plugin-pf4-rhel9: no versions given (not affected: from 1782839279 before *)
- cluster-observability-operator/logging-console-plugin-pf5-rhel9: no versions given (not affected: from 1782840539 before *)
- cluster-observability-operator/troubleshooting-panel-console-plugin-pf6-rhel9: no versions given (not affected: from 1782839996 before *)
- devspaces/code-rhel9: no versions given (not affected: from 1776744110 before *)
- handlebars: no versions given
- openshift-logging/elasticsearch6-rhel9: no versions given
- openshift-logging/elasticsearch-operator-bundle: no versions given
- openshift-logging/elasticsearch-proxy-rhel9: no versions given
- openshift-logging/elasticsearch-rhel9-operator: no versions given
- openshift-logging/kibana6-rhel8: no versions given
- openshift-logging/logging-curator5-rhel9: no versions given
- rhdh/rhdh-hub-rhel9: no versions given
- firefox: no versions given
- thunderbird: no versions given
- 389-ds:1.4/389-ds-base: no versions given
- grafana: no versions given
- mozjs60: no versions given
- rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9: no versions given
- devspaces/dashboard-rhel9: no versions given
- handlebars (npm): from 4.0.0 before 4.7.9
- handlebarsjs handlebars: from 4.0.0 before 4.7.9

## Every score

- GitHub_M: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- redhat-SADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-2w6w-674q-4c4q> (exploit, vendor-advisory, web)
- <https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2> (patch, web)
- <https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9> (release-notes, web)
- <https://access.redhat.com/security/cve/CVE-2026-33937> (vdb-entry)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2452523> (issue-tracking)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33937.json>
- <https://access.redhat.com/errata/RHSA-2026:34342> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2026:10175> (vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33937> (advisory)
- <https://github.com/handlebars-lang/handlebars.js> (package)

## Sources

- CVE List: [CVE-2026-33937](https://www.cve.org/CVERecord?id=CVE-2026-33937), CVE Terms of Use, modified 2026-09-04
- GitHub Advisory Database: [GHSA-2w6w-674q-4c4q](https://github.com/advisories/GHSA-2w6w-674q-4c4q), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-33937](https://nvd.nist.gov/vuln/detail/CVE-2026-33937), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-33937 · Whole record: https://cve.day/CVE-2026-33937.json · Rebuilt by cve.day 2026-11-25T22:59:17.447Z
