Lucene search

K
githubGitHub Advisory DatabaseGHSA-Q765-WM9J-66QJ
HistorySep 03, 2024 - 7:42 p.m.

@blakeembrey/template vulnerable to code injection when attacker controls template input

2024-09-0319:42:25
CWE-94
GitHub Advisory Database
github.com
10
code injection
template input
security patch
untrusted input
display name
vulnerability
upgrade
github fix

CVSS3

9.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

AI Score

7

Confidence

High

EPSS

0.001

Percentile

40.4%

Impact

It is possible to inject and run code within the template if the attacker has access to write the template name.

const { template } = require('@blakeembrey/template');

template("Hello {{name}}!", "exploit() {} && ((()=>{ console.log('success'); })()) && function pwned");

Patches

Upgrade to 1.2.0.

Workarounds

Don’t pass untrusted input as the template display name, or don’t use the display name feature.

References

Fixed by removing in https://github.com/blakeembrey/js-template/commit/b8d9aa999e464816c6cfb14acd1ad0f5d1e335aa.

Affected configurations

Vulners
Node
blakeembreytemplateRange<1.2.0node.js
VendorProductVersionCPE
blakeembreytemplate*cpe:2.3:a:blakeembrey:template:*:*:*:*:*:node.js:*:*

CVSS3

9.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

AI Score

7

Confidence

High

EPSS

0.001

Percentile

40.4%

Related for GHSA-Q765-WM9J-66QJ