Skip to content
Heist/ feed
Back to feed
High

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

Type: advisorySources: OSV

@blakeembrey/template is a string template library. Prior to version 1.2.0, it is possible to inject and run code within the template if the attacker has access to write the template name. Version 1.2.0 contains a patch. As a workaround, don't pass untrusted input as the template display name, or don't use the display name feature.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-45390
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 16:25 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 3 Sept 2024, 19:37 UTC

@blakeembrey/template is a string template library. Prior to version 1.2.0, it is possible to inject and run code within the template if the attacker has access to write the template name. Version 1.2.0 contains a patch. As a workaround, don't pass untrusted input as the template display name, or don't use the display name feature.

osv:CVE-2024-45390
Complete source record
{
  "id": "371c7495fe2c16a2bf4dc01fc5568c007a26143f5cd4c1c0eff83f90ad9e35d5",
  "url": "https://osv.dev/vulnerability/CVE-2024-45390",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "@blakeembrey/template vulnerable to code injection when attacker controls template input",
    "summary": "@blakeembrey/template is a string template library. Prior to version 1.2.0, it is possible to inject and run code within the template if the attacker has access to write the template name. Version 1.2.0 contains a patch. As a workaround, don't pass untrusted input as the template display name, or don't use the display name feature.",
    "evidence": "osv:CVE-2024-45390",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2024-45390",
      "aliases": [
        "CVE-2024-45390",
        "GHSA-q765-wm9j-66qj"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/blakeembrey/js-template",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "22f70c7c3efd00424d861f390c02672b72d37f9b"
                },
                {
                  "fixed": "b8d9aa999e464816c6cfb14acd1ad0f5d1e335aa"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:blakeembrey:template:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.2.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "b8d9aa999e464816c6cfb14acd1ad0f5d1e335aa"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.1.0",
            "v1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-45390.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:37.593141607Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45390.json",
        "https://github.com/blakeembrey/js-template/security/advisories/GHSA-q765-wm9j-66qj",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-45390",
        "https://github.com/blakeembrey/js-template/commit/b8d9aa999e464816c6cfb14acd1ad0f5d1e335aa"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-94"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45390.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-45390",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 504666,
  "published_at": "2024-09-03T19:37:31.763+00:00"
}