Skip to content
Heist/ feed
Back to feed
HighFix available

node-handlebars — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2026-33941

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.

Products
node-handlebars
Affected versions
3:4.7.10-1, 3:4.7.7+~4.1.0-1, 3:4.7.9-1, 3:4.7.9-2, 3:4.7.9-3, 3:4.7.9-4, 3:4.7.9-5, 3:4.7.9-6
Fixed versions
3:4.7.9-1
CVEs
CVE-2026-33941
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 17:50 UTC · Revision 2

Source evidence

DEBIAN-CVE-2026-33941

core-osv · Original source

Published 27 Mar 2026, 22:16 UTC

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.

osv:DEBIAN-CVE-2026-33941

node-handlebars

Fixed versions: Not specified

node-handlebars

Fixed versions: Not specified

node-handlebars

Fixed versions: 3:4.7.9-1

Complete source record
{
  "id": "df3af260b18a64f5980286642eedba288e19e71ed0d0f89b9262939cb9b5cbd4",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-33941",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2026-33941",
    "summary": "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.",
    "evidence": "osv:DEBIAN-CVE-2026-33941",
    "products": [
      {
        "name": {
          "value": "node-handlebars",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3:4.7.10-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.7+~4.1.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.9-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.9-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.9-3",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.9-4",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.9-5",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "3:4.7.9-6",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-handlebars",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "3:4.7.10-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.7+~4.1.0-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.9-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.9-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.9-3",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.9-4",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.9-5",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "3:4.7.9-6",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "node-handlebars",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3:4.7.9-1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "3:4.7.7+~4.1.0-1",
            "evidence": "/affected/2/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2026-33941",
      "aliases": [
        "DEBIAN-CVE-2026-33941"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-handlebars",
            "purl": "pkg:deb/debian/node-handlebars?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "3:4.7.10-1",
            "3:4.7.7+~4.1.0-1",
            "3:4.7.9-1",
            "3:4.7.9-2",
            "3:4.7.9-3",
            "3:4.7.9-4",
            "3:4.7.9-5",
            "3:4.7.9-6"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-33941.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "node-handlebars",
            "purl": "pkg:deb/debian/node-handlebars?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "versions": [
            "3:4.7.10-1",
            "3:4.7.7+~4.1.0-1",
            "3:4.7.9-1",
            "3:4.7.9-2",
            "3:4.7.9-3",
            "3:4.7.9-4",
            "3:4.7.9-5",
            "3:4.7.9-6"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-33941.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3:4.7.9-1"
                }
              ]
            }
          ],
          "package": {
            "name": "node-handlebars",
            "purl": "pkg:deb/debian/node-handlebars?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "versions": [
            "3:4.7.7+~4.1.0-1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-33941.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-27T10:00:59.193160624Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-33941"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2026-33941"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-33941",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 461361,
  "published_at": "2026-03-27T22:16:21.203+00:00"
}