Skip to content
Heist/ feed
Back to feed
MediumFix available

Handlebars: JavaScript Injection via Unsafe Inline Embedding of Precompiled Templates

Type: advisorySources: OSV

## Summary `Handlebars.precompile()` generates JavaScript source that is commonly embedded in browser `` was emitted unchanged. HTML parsers recognize `` even inside a JavaScript string literal, closing the surrounding script element and allowing following attacker-controlled markup to be parsed and executed. This affects applications that precompile attacker-controlled templates and embed the generated source directly in an HTML `` terminates the element regardless of JavaScript string context. On affected releases, this template: ```handlebars safe` closes the script containing the precompiled template. The next `')); ``` Affected versions print `true`. Embedding `output` directly in an inline `

Products
handlebars
Affected versions
Not specified
Fixed versions
4.7.10
CVEs
CVE-2026-106444
Confirmed fixed CVEs
Not specified
Updated in this feed
28 Oct 2026, 10:03 UTC · Revision 1

Source evidence

Handlebars: JavaScript Injection via Unsafe Inline Embedding of Precompiled Templates

core-osv · Original source

Published 8 Oct 2026, 17:52 UTC

## Summary `Handlebars.precompile()` generates JavaScript source that is commonly embedded in browser `` was emitted unchanged. HTML parsers recognize `` even inside a JavaScript string literal, closing the surrounding script element and allowing following attacker-controlled markup to be parsed and executed. This affects applications that precompile attacker-controlled templates and embed the generated source directly in an HTML `` terminates the element regardless of JavaScript string context. On affected releases, this template: ```handlebars safe` closes the script containing the precompiled template. The next `')); ``` Affected versions print `true`. Embedding `output` directly in an inline `

osv:GHSA-xw65-4hp5-5hc7

handlebars

Fixed versions: 4.7.10

Complete source record
{
  "id": "dbb2989f9a50e3e85474ce8f6a94cdabfb0de01cdc55d4092929f102cd60a0a8",
  "url": "https://osv.dev/vulnerability/GHSA-xw65-4hp5-5hc7",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Handlebars: JavaScript Injection via Unsafe Inline Embedding of Precompiled Templates",
    "summary": "## Summary `Handlebars.precompile()` generates JavaScript source that is commonly embedded in browser `` was emitted unchanged. HTML parsers recognize `` even inside a JavaScript string literal, closing the surrounding script element and allowing following attacker-controlled markup to be parsed and executed. This affects applications that precompile attacker-controlled templates and embed the generated source directly in an HTML `` terminates the element regardless of JavaScript string context. On affected releases, this template: ```handlebars safe` closes the script containing the precompiled template. The next `')); ``` Affected versions print `true`. Embedding `output` directly in an inline `",
    "evidence": "osv:GHSA-xw65-4hp5-5hc7",
    "products": [
      {
        "name": {
          "value": "handlebars",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.7.10",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "GHSA-xw65-4hp5-5hc7",
      "aliases": [
        "CVE-2026-106444",
        "GHSA-xw65-4hp5-5hc7"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "4.0.0"
                },
                {
                  "fixed": "4.7.10"
                }
              ]
            }
          ],
          "package": {
            "name": "handlebars",
            "purl": "pkg:npm/handlebars",
            "ecosystem": "npm"
          },
          "database_specific": {
            "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-xw65-4hp5-5hc7/GHSA-xw65-4hp5-5hc7.json",
            "last_known_affected_version_range": "<= 4.7.9"
          }
        }
      ],
      "modified": "2026-10-08T18:00:09.713255773Z",
      "provider": "osv",
      "references": [
        "https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-xw65-4hp5-5hc7",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-106444",
        "https://github.com/handlebars-lang/handlebars.js/pull/2185",
        "https://github.com/handlebars-lang/handlebars.js/commit/609d1b11c833c9a3e00f56f2f34d22f425446725",
        "https://github.com/handlebars-lang/handlebars.js",
        "https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.10"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-116"
        ],
        "severity": "MODERATE",
        "github_reviewed": true,
        "nvd_published_at": "2026-10-06T20:17:26Z",
        "github_reviewed_at": "2026-10-08T17:52:37Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-106444",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 104438,
  "published_at": "2026-10-08T17:52:37+00:00"
}