PT-2026-28569 · Unknown · Handlebars

·

CVE-2026-33937

·

Publicado

2026-03-26

·

Atualizado

2026-08-31

CVSS v2.0

10

Crítica

VetorAV:N/AC:L/Au:N/C:C/I:C/A:C
Name of the Vulnerable Software and Affected Versions Handlebars versions 4.0.0 through 4.7.8
Description Handlebars allows Remote Code Execution (RCE) through a crafted Abstract Syntax Tree (AST) object. The Handlebars.compile() function accepts either a template string or a pre-parsed AST. When an AST is supplied, the value field of a NumberLiteral AST node is emitted directly into the generated JavaScript without proper sanitization. This allows an attacker who can supply a crafted AST to compile() to inject and execute arbitrary JavaScript code on the server. The vulnerable code path resides in lib/handlebars/compiler/javascript-compiler.js, where NumberLiteral values are appended to the generated code without escaping. Any endpoint that deserializes user-controlled JSON and passes the result directly to Handlebars.compile() is potentially exploitable. An attacker can leverage this to execute commands on the server, as demonstrated by a proof of concept that uses process.getBuiltinModule('child process').execFileSync('id') to execute the 'id' command.
Recommendations Handlebars versions prior to 4.7.9 are affected. Validate input type before calling Handlebars.compile(): ensure the argument is always a string, never a plain object or JSON-deserialized value. Use the Handlebars runtime-only build (handlebars/runtime) on the server if templates are pre-compiled at build time; compile() will be unavailable.

Exploit

Correção

DoS

RCE

Type Confusion

Code Injection

Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾

Enumeração de Fraquezas

Identificadores relacionados

BDU:2026-09393
CLEANSTART-2026-AD27625
CLEANSTART-2026-BE61221
CLEANSTART-2026-KS09647
CLEANSTART-2026-LC05413
CLEANSTART-2026-TW25027
CLEANSTART-2026-TZ34913
CLEANSTART-2026-XR95601
CVE-2026-33937
GHSA-2W6W-674Q-4C4Q

Produtos afetados

Handlebars