handlebars.js: Improper Neutralization of Input During Web Page Generation
CVE-2026-33941 is a high-severity improper neutralization of input during web page generation vulnerability in handlebars.js from Handlebars-lang, with a CVSS 3.1 base score of 8.2 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, but only if a user takes part, for example by opening a link or file. Affected handlebars.js versions: >= 4.0.0, < 4.7.9. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.3% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Handlebars to 4.7.9 or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Handlebars-lang | handlebars.js | >= 4.0.0, < 4.7.9 | Not stated |
| Red Hat | Cluster Observability Operator 1.5.0 | Not specified in the record | Not stated |
| Red Hat | Red Hat OpenShift Dev Spaces 3.27 | Not specified in the record | Not stated |
| Red Hat | Cryostat 4 | Not specified in the record | Not stated |
| Red Hat | Logging Subsystem for Red Hat OpenShift | Not specified in the record | Not stated |
| Red Hat | Red Hat Data Grid 8 | Not specified in the record | Not stated |
| Red Hat | Red Hat Developer Hub | Not specified in the record | Not stated |
| Red Hat | Red Hat Enterprise Linux 10 | Not specified in the record | Not stated |
| Red Hat | Red Hat Enterprise Linux 7 | Not specified in the record | Not stated |
| Red Hat | Red Hat Enterprise Linux 8 | Not specified in the record | Not stated |
| Red Hat | Red Hat Enterprise Linux 9 | Not specified in the record | Not stated |
| Red Hat | Red Hat OpenShift AI (RHOAI) | Not specified in the record | Not stated |
| Red Hat | Red Hat Process Automation 7 | Not specified in the record | Not stated |
| Handlebarsjs | Handlebars | 4.0.0 up to, but not including, 4.7.9 | 4.7.9 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- RequiredA user must take an action such as opening a file or link.
- Scope
- ChangedThe attack can reach beyond the vulnerable component into other systems.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.2 | High | CNA (github.com) |
| CVSS 3.1 | 8.2 | High | NVD |
| CVSS 3.1 | 8.2 | High | CNA |
Official description
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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Neutralization of Input During Web Page Generation
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
How developers prevent this class of flaw
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
- Understand all the potential areas where untrusted inputs can enter your software: parameters or arguments, cookies, anything read from the network, environment variables, reverse DNS lookups, query results, request headers, URL components, e-mail, files, filenames, databases, and any external systems that provide data to the application. Remember that such inputs may be obtained indirectly through API calls.
- For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
More Improper Neutralization of Input During Web Page Generation vulnerabilities (CWE-79)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
Other references
Other vulnerabilities in handlebars.js
- 9.8 Critical severity
- 9.2 Critical severity
- 8.1 High severity
- 7.5 High severity
- 8.1 High severity
- 9.8 Critical severity
Recent Improper Neutralization of Input During Web Page Generation vulnerabilities
- 8.2 High severity
- 9.6 Critical severity
- 8.6 High severity
- 8.2 High severity
- 8.1 High severity
- 8.7 High severity
Spotted an error? Tell us.