CVE-2026-33941
Beskrivelse
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.
Beskrivelsen gjengis slik kilden har publisert den, på engelsk.
Nøkkelfakta
- Publisert
- 2026-03-27
- Sist endret
- 2026-10-26
- Tildelt av
- security-advisories@github.com
- CVSS-vektor
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H- Scoret av
- nvd@nist.gov (NVD Primary)
- Sannsynlighet for utnyttelse
-
0.3 %
høyere enn 21 %
av alle kjente sårbarheter
EPSS, neste 30 dager, modell v2026.06.15 - Rettelse finnes
- Ja, se referansene
Berørte produkter
| Leverandør | Produkt | Versjoner | Status |
|---|---|---|---|
| Handlebarsjs | Handlebars | ≥ 4.0.0, < 4.7.9 | Berørt |
Svakhetstype
-
CWE-116: Improper Encoding or Escaping of Output
The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not p…
-
CWE-79: 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.
-
CWE-94: Improper Control of Generation of Code
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or b…
Angrepsteknikker
Utledet gjennom svakhetstypen: CVE til CWE til CAPEC til ATT&CK. Dette viser hvilke teknikker svakhetsklassen historisk brukes til. Det er ikke en påstand om at nettopp denne sårbarheten er utnyttet slik.
- T1027.006: HTML Smuggling
- T1027.009: Embedded Payloads
- T1564.009: Resource Forking
Referanser
- https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe6…
- https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9
- https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-xjpj-3mr7-gcpf
- https://access.redhat.com/errata/RHSA-2026:10175
- https://access.redhat.com/errata/RHSA-2026:34342
- 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
Berører dette dere?
En sårbarhet betyr bare noe hvis dere kjører produktet, i en berørt versjon, et sted en angriper kommer til.