Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

redhat логотип

CVE-2026-33938

Опубликовано: 27 мар. 2026
Источник: redhat
CVSS3: 8.1
EPSS Низкий

Описание

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, the @partial-block special variable is stored in the template data context and is reachable and mutable from within a template via helpers that accept arbitrary objects. When a helper overwrites @partial-block with a crafted Handlebars AST, a subsequent invocation of {{> @partial-block}} compiles and executes that AST, enabling arbitrary JavaScript execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. First, use the runtime-only build (require('handlebars/runtime')). The compile() method is absent, eliminating the vulnerable fallback path. Second, audit registered helpers for any that write arbitrary values to context objects. Helpers should treat context data as read-only. Third, avoid registering helpers from third-party packages (such as handlebars-helpers) in contexts where templates or context data can be influenced by untrusted input.

A flaw was found in Handlebars. A remote attacker can exploit this vulnerability by manipulating the @partial-block special variable within the template data context. By overwriting @partial-block with a specially crafted Abstract Syntax Tree (AST) through a helper, a subsequent invocation of {{> @partial-block}} will compile and execute the malicious AST. This enables arbitrary JavaScript execution on the server, leading to potential compromise of the system.

Отчет

Important: A flaw in Handlebars allows arbitrary code execution when processing untrusted input. This occurs if an attacker can manipulate the @partial-block special variable through a helper, leading to the execution of a crafted Abstract Syntax Tree. Red Hat products are affected if they use Handlebars versions 4.0.0 through 4.7.8 in server-side applications where untrusted input can influence template data or context objects. Deployments utilizing the Handlebars runtime-only build are not vulnerable.

Меры по смягчению последствий

Applications using Handlebars should implement the runtime-only build (require('handlebars/runtime')) to prevent exploitation, as this build lacks the vulnerable compile() method. Additionally, review all registered helpers to ensure they do not write arbitrary values to context objects, and avoid using third-party helpers in contexts exposed to untrusted input.

Затронутые пакеты

ПлатформаПакетСостояниеРекомендацияРелиз
Cryostat 4handlebarsNot affected
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch6-rhel9Will not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch-operator-bundleWill not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch-proxy-rhel9Will not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/elasticsearch-rhel9-operatorWill not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/kibana6-rhel8Will not fix
Logging Subsystem for Red Hat OpenShiftopenshift-logging/logging-curator5-rhel9Will not fix
Red Hat Data Grid 8handlebarsNot affected
Red Hat Enterprise Linux 10firefoxNot affected
Red Hat Enterprise Linux 10thunderbirdNot affected

Показывать по

Дополнительная информация

Статус:

Important
Дефект:
CWE-917
https://bugzilla.redhat.com/show_bug.cgi?id=2452525handlebars: Handlebars: Arbitrary code execution via @partial-block overwrite

EPSS

Процентиль: 50%
0.00709
Низкий

8.1 High

CVSS3

Связанные уязвимости

CVSS3: 8.1
ubuntu
4 месяца назад

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, the `@partial-block` special variable is stored in the template data context and is reachable and mutable from within a template via helpers that accept arbitrary objects. When a helper overwrites `@partial-block` with a crafted Handlebars AST, a subsequent invocation of `{{> @partial-block}}` compiles and executes that AST, enabling arbitrary JavaScript execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. First, use the runtime-only build (`require('handlebars/runtime')`). The `compile()` method is absent, eliminating the vulnerable fallback path. Second, audit registered helpers for any that write arbitrary values to context objects. Helpers should treat context data as read-only. Third, avoid registering helpers from third-party packages (such as `handlebars-helpers`) in contexts where templates or context data can be influenced by u...

CVSS3: 8.1
nvd
4 месяца назад

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, the `@partial-block` special variable is stored in the template data context and is reachable and mutable from within a template via helpers that accept arbitrary objects. When a helper overwrites `@partial-block` with a crafted Handlebars AST, a subsequent invocation of `{{> @partial-block}}` compiles and executes that AST, enabling arbitrary JavaScript execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. First, use the runtime-only build (`require('handlebars/runtime')`). The `compile()` method is absent, eliminating the vulnerable fallback path. Second, audit registered helpers for any that write arbitrary values to context objects. Helpers should treat context data as read-only. Third, avoid registering helpers from third-party packages (such as `handlebars-helpers`) in contexts where templates or context data can be influenced by unt

msrc
4 месяца назад

Handlebars.js has JavaScript Injection via AST Type Confusion by tampering @partial-block

CVSS3: 8.1
debian
4 месяца назад

Handlebars provides the power necessary to let users build semantic te ...

CVSS3: 8.1
github
4 месяца назад

Handlebars.js has JavaScript Injection via AST Type Confusion by tampering @partial-block

EPSS

Процентиль: 50%
0.00709
Низкий

8.1 High

CVSS3