
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-33941 is a JavaScript injection vulnerability in the Handlebars CLI precompiler (bin/handlebars / lib/precompiler.js) that allows an attacker who can influence template filenames or CLI arguments to inject arbitrary JavaScript into the generated output bundle. The vulnerability affects Handlebars (npm) versions 4.0.0 through 4.7.8 and was disclosed on March 26, 2026, with a fix released the same day. It carries a CVSS v3.1 base score of 8.2 (High) (GitHub Advisory). Multiple IBM products that bundle Handlebars as a dependency are also affected, including IBM App Connect Enterprise, API Connect, Cloud Pak for Integration, and others (IBM Advisory).
The root cause is improper encoding or escaping of output (CWE-116) combined with code injection (CWE-94) and cross-site scripting (CWE-79). The lib/precompiler.js file constructs JavaScript source code by directly string-interpolating user-controlled values — template file names and CLI options — without any escaping or sanitization. Four distinct injection points exist: (1) template name injection, where a filename containing " or ']; breaks out of the string literal; (2) namespace injection (-n/--namespace), where a semicolon in the value introduces additional JavaScript statements; (3) CommonJS path injection (-c/--commonjs), where a " closes the require() string; and (4) AMD path injection (-h/--handlebarPath), where a ' closes the array element. Exploitation requires low privileges and user interaction (a user must load the generated bundle), but the scope is changed — injected code executes in the context of the Node.js process or browser loading the bundle (GitHub Advisory).
Successful exploitation allows an attacker to achieve arbitrary code execution in Node.js or browser environments when the generated precompiled bundle is loaded. The injected JavaScript runs with the privileges of the process loading the bundle, enabling full confidentiality, integrity, and availability compromise of the affected system — including reading sensitive files, writing arbitrary data to disk, or disrupting service. In CI/CD pipelines that automatically consume and execute precompiled Handlebars bundles, this vulnerability could enable supply-chain-style attacks affecting downstream consumers of the build artifacts (GitHub Advisory).
A public proof-of-concept (PoC) with concrete bash commands demonstrating all four injection vectors is available in the official security advisory (GitHub Advisory). There is no evidence of in-the-wild exploitation at this time, and no threat actor attribution has been reported. The EPSS score is approximately 0.009% (1st percentile), indicating a low current probability of exploitation. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Detection signatures are available via Nessus (plugin 304160) and multiple Qualys detection IDs.
node bin/handlebars) with attacker-influenced inputs — either template filenames from a repository or CLI arguments passed from user-controlled configuration.mkdir -p templates
printf 'Hello' > "templates/evil'] = (function(){require(\"fs\").writeFileSync(\"pwned\",\"1\")})(); //.handlebars"node bin/handlebars templates -o out.jsnode -e 'require("./out.js")' # Creates ./pwned on disk-n CLI argument to avoid needing filesystem access:node bin/handlebars templates -o out.js -n "App.ns; require('fs').writeFileSync('pwned2','1'); //"
node -e 'require("./out.js")'-c (CommonJS path) or -h (AMD handlebar path) arguments with payloads that close the surrounding string literal and append arbitrary JavaScript statements (GitHub Advisory).pwned, pwned2, pwned3, pwned4) following execution of a Handlebars precompiled bundle; template files with unusually long or special-character-containing filenames (e.g., containing ", ', ];, or ;) in template directories consumed by build pipelines.out.js or similar precompiled bundle files containing raw JavaScript statements outside of expected templates[...] assignments; presence of require('fs'), writeFileSync, exec, or other Node.js built-in calls in precompiled output files.node bin/handlebars with CLI arguments containing semicolons, quotes, or other JavaScript-significant characters in namespace (-n), commonjs (-c), or handlebarPath (-h) values.sh, bash, curl, wget) that are not part of normal application behavior (GitHub Advisory).Primary remediation: Upgrade Handlebars (npm) to version 4.7.9, which fixes the issue by introducing a quoteForJavaScript() function using JSON.stringify for safe string embedding, a isValidNamespace() regex validator for namespace values, and a sanitizeSourceMapComment() function to strip line terminators (v4.7.9 Release, Fix Commit). Workarounds (if immediate patching is not possible): (1) Validate all CLI inputs before invoking the precompiler — reject filenames and option values containing ", ', ;, or other JavaScript string-escaping characters; (2) use fixed, trusted namespace strings from configuration files rather than command-line arguments in automated pipelines; (3) run the precompiler in a sandboxed container with no write access to sensitive paths; (4) audit template filenames in any repository consumed by automated build pipelines (GitHub Advisory). IBM product users should apply the relevant IBM security bulletins for affected products.
The vulnerability was reported by security researcher Gyde04 and published by maintainer jaylinski on March 26, 2026, with a same-day patch release (GitHub Advisory). IBM issued multiple security bulletins across its product portfolio (App Connect Enterprise, API Connect, Cloud Pak for Integration, QRadar Suite, Business Automation Insights, and others) acknowledging the impact of this vulnerability on products bundling Handlebars (IBM Advisory). The vulnerability received coverage from security aggregators including CVEFeed, VulDB, and The Hacker Wire shortly after disclosure, and Tenable published a Nessus detection plugin (304160) within days.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."