GHSA-2cf5-4w76-r9qv
ADVISORY - githubSummary
Versions of handlebars
prior to 3.0.8 or 4.5.2 are vulnerable to Arbitrary Code Execution. The package's lookup helper fails to properly validate templates, allowing attackers to submit templates that execute arbitrary JavaScript in the system. It can be used to run arbitrary code in a server processing Handlebars templates or on a victim's browser (effectively serving as Cross-Site Scripting).
The following template can be used to demonstrate the vulnerability:
{{#with split as |a|}}
{{pop (push "alert('Vulnerable Handlebars JS');")}}
{{#with (concat (lookup join (slice 0 1)))}}
{{#each (slice 2 3)}}
{{#with (apply 0 a)}}
{{.}}
{{/with}}
{{/each}}
{{/with}}
{{/with}}
{{/with}}```
## Recommendation
Upgrade to version 3.0.8, 4.5.2 or later.
Common Weakness Enumeration (CWE)
Improper Control of Generation of Code ('Code Injection')
GitHub
1.5
CVSS SCORE
7.3highPackage | Type | OS Name | OS Version | Affected Ranges | Fix Versions |
---|---|---|---|---|---|
handlebars | npm | - | - | <3.0.8 | 3.0.8 |
handlebars | npm | - | - | >=4.0.0,<4.5.2 | 4.5.2 |
CVSS:3 Severity and metrics
The CVSS metrics represent different qualitative aspects of a vulnerability that impact the overall score, as defined by the CVSS Specification.
The vulnerable component is not bound to the network stack and the attacker's path is via read/write/execute capabilities. Either: The attacker exploits the vulnerability by accessing the target system locally (e.g., keyboard, console), or remotely (e.g., SSH); or the attacker relies on User Interaction by another person to perform actions required to exploit the vulnerability (e.g., using social engineering techniques to trick a legitimate user into opening a malicious document).
Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.
The attacker requires privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.
Successful exploitation of this vulnerability requires a user to take some action before the vulnerability can be exploited. For example, a successful exploit may only be possible during the installation of an application by a system administrator.
An exploited vulnerability can affect resources beyond the security scope managed by the security authority of the vulnerable component. In this case, the vulnerable component and the impacted component are different and managed by different security authorities.
There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is limited. The information disclosure does not cause a direct, serious loss to the impacted component.
There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any or all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.
Performance is reduced or there are interruptions in resource availability. Even if repeated exploitation of the vulnerability is possible, the attacker does not have the ability to completely deny service to legitimate users. The resources in the impacted component are either partially available all of the time, or fully available only some of the time, but overall there is no direct, serious consequence to the impacted component.
Chainguard
CGA-34fq-468h-wq8q
-
Chainguard
CGA-3893-jx2c-q3f7
-
Chainguard
CGA-3xqr-g9c8-v9j3
-
Chainguard
CGA-4g8g-r8cx-qx9m
-
Chainguard
CGA-4m35-2rgh-65fc
-
Chainguard
CGA-52j3-f4m6-5f5m
-
Chainguard
CGA-637q-37w4-57pg
-
Chainguard
CGA-8253-m4hm-r5fr
-
Chainguard
CGA-883j-8c8q-433h
-
Chainguard
CGA-8gvf-26j7-fj23
-
Chainguard
CGA-9gm6-p8hg-p42v
-
Chainguard
CGA-9r44-32q3-gchm
-
Chainguard
CGA-9r5j-xgqc-mffg
-
Chainguard
CGA-cf75-f79f-mmjx
-
Chainguard
CGA-fx4w-vw59-ph7h
-
Chainguard
CGA-h53q-9j3x-qrj4
-
Chainguard
CGA-hrx8-hp49-r2gv
-
Chainguard
CGA-j6vw-969w-cfrc
-
Chainguard
CGA-jwpp-hp8w-px5v
-
Chainguard
CGA-m2x9-pj4q-83q2
-
Chainguard
CGA-mp8m-rpm6-32xx
-
Chainguard
CGA-qffm-65r7-8wcm
-
Chainguard
CGA-r2gw-5jrf-h986
-
Chainguard
CGA-rr8w-qw7q-6fgv
-
Chainguard
CGA-rwmp-7jr8-jcgw
-
Chainguard
CGA-v73j-534p-mmmh
-
Chainguard
CGA-vrp7-r4mm-xwfh
-
Chainguard
CGA-vw95-j44r-gj9x
-
Chainguard
CGA-wxhm-p9j4-p37c
-
Chainguard
CGA-x32q-v6p8-pwm9
-