Vulnerabilities in pkg:npm/tmpl

PACKAGE
Advisory Identifier: GHSA-jgrx-mgxx-jf9v
Advisory Summary

CVE-2021-3777 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Tmpl libraries in the npm ecosystem. The issue involves tmpl vulnerable to inefficient regular expression complexity which may lead to resource exhaustion. Remediation is available by upgrading affected packages to version 1.0.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/tmpl

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/tmpl. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jgrx-mgxx-jf9v CVE-2021-3777 HIGH tmpl vulnerable to Inefficient Regular Expression Complexity which may lead to resource exhaustion

CVE-2021-3777 at a Glance

CVE Identifier CVE-2021-3777
GHSA Identifier GHSA-jgrx-mgxx-jf9v
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Tmpl
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2021-3777

To remediate this vulnerability, upgrade all affected Tmpl dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tmpl fixed: 1.0.5
npm install tmpl@1.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls tmpl

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-3777, inspect your project dependencies using npm:

npm ls tmpl

Analyze the terminal output to locate any version of Tmpl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.5), your application is affected.

Note: The npm ls tmpl command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Tmpl, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

nodejs-tmpl is simple string formatting. tmpl is vulnerable to Inefficient Regular Expression Complexity which may lead to resource exhaustion.

CVE-2021-3777 Affected Tmpl Versions

1 component(s)
Fixed Versions:
1.0.5
Product / Package Ecosystem Affected Versions Fixed Version
tmpl
npm
< 1.0.5
1.0.5

References

Frequently Asked Questions

What is CVE-2021-3777?
CVE-2021-3777 is a security vulnerability in Tmpl involving tmpl vulnerable to Inefficient Regular Expression Complexity which may lead to resource exhaustion under CWE-400: Uncontrolled Resource Consumption.
Which Tmpl versions are affected?
Affected versions include releases prior to 1.0.5 across affected packages: tmpl.
What version fixes CVE-2021-3777?
Upgrading to 1.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tmpl affected?
Yes, tmpl is affected in releases prior to 1.0.5. Upgrade your dependency to 1.0.5 or later.
What is the CVSS score of CVE-2021-3777?
CVE-2021-3777 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-3777?
CVE-2021-3777 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2021-3777?
Run the dependency tree command: 'npm ls tmpl'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jgrx-mgxx-jf9v",
  "modified" : "2022-08-10T23:37:11Z",
  "published" : "2021-09-20T20:27:52Z",
  "aliases" : [ "CVE-2021-3777" ],
  "summary" : "tmpl vulnerable to Inefficient Regular Expression Complexity which may lead to resource exhaustion",
  "details" : "nodejs-tmpl is simple string formatting. tmpl is vulnerable to Inefficient Regular Expression Complexity which may lead to resource exhaustion.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tmpl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3777"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/daaku/nodejs-tmpl/commit/4c654e4d1542f329ed561fd95ccd80f30c6872d6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/daaku/nodejs-tmpl"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/a07b547a-f457-41c9-9d89-ee48bee8a4df"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-16T17:05:45Z",
    "nvd_published_at" : "2021-09-15T08:15:00Z"
  }
}