NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2024-45390: @blakeembrey/template vulnerable to code injection when attacker controls template input

mediumCVSS 4.0 6.9 · 3.1 7.3GHSA-q765-wm9j-66qj

Impact It is possible to inject and run code within the template if the attacker has access to write the template name. 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.

Published Sep 3, 2024 · Updated Nov 18, 2024

Affected packages

@blakeembrey/template

Ecosystem
npm
Affected
< 1.2.0
Fixed in
1.2.0
Check
npm ls @blakeembrey/template

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to mcoimbra, filipeom.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology