GHSA-5rqg-jm4f-cqx7: Colors Denial of Service Vulnerability

HIGH
CWE-835
Published
Advisory Summary

GHSA-5rqg-jm4f-cqx7 is a HIGH denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Colors libraries in the npm ecosystem. The issue involves infinite loop causing denial of service in colors. Remediation is available in the latest vendor maintenance releases.

GHSA-5rqg-jm4f-cqx7 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5rqg-jm4f-cqx7
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Colors
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-5rqg-jm4f-cqx7

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

colors fixed: Latest secure release
npm install colors@Latest secure release
colors fixed: Latest secure release
npm install colors@Latest secure release
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 colors

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-5rqg-jm4f-cqx7, inspect your project dependencies using npm:

npm ls colors

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

Note: The npm ls colors 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Colors, 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

colors is a library for including colored text in node.js consoles. Between 07 and 09 January 2022, colors versions 1.4.1, 1.4.2, and 1.4.44-liberty-2 were published including malicious code that caused a Denial of Service due to an infinite loop. Software dependent on these versions experienced the printing of randomized characters to console and an infinite loop resulting in unbound system resource consumption. Users of colors relying on these specific versions should downgrade to version 1.4.0.

GHSA-5rqg-jm4f-cqx7 Affected Colors Versions

2 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
colors
npm
≥ 1.4.1
≤ 1.4.2
colors
npm
1.4.44-liberty-2
All 1 versions
1.4.44-liberty-2
None specified

References

Frequently Asked Questions

What is GHSA-5rqg-jm4f-cqx7?
GHSA-5rqg-jm4f-cqx7 is a security vulnerability in Colors involving Infinite loop causing Denial of Service in colors under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Colors versions are affected?
Affected versions include releases prior to current release patches across affected packages: colors.
What version fixes GHSA-5rqg-jm4f-cqx7?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is colors affected?
Yes, colors is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-5rqg-jm4f-cqx7?
GHSA-5rqg-jm4f-cqx7 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check npm dependencies for GHSA-5rqg-jm4f-cqx7?
Run the dependency tree command: 'npm ls colors'. 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-5rqg-jm4f-cqx7",
  "modified" : "2022-01-10T19:56:36Z",
  "published" : "2022-01-10T17:29:53Z",
  "aliases" : [ ],
  "summary" : "Infinite loop causing Denial of Service in colors",
  "details" : "colors is a library for including colored text in node.js consoles. Between 07 and 09 January 2022, colors versions 1.4.1, 1.4.2, and 1.4.44-liberty-2 were published including malicious code that caused a Denial of Service due to an infinite loop. Software dependent on these versions experienced the printing of randomized characters to console and an infinite loop resulting in unbound system resource consumption.\n\nUsers of colors relying on these specific versions should downgrade to version 1.4.0.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "colors"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.1"
      }, {
        "last_affected" : "1.4.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "colors"
    },
    "versions" : [ "1.4.44-liberty-2" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Marak/colors.js/commit/137c6dae3339e97f4bbc838c221803c363b0a9fd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Marak/colors.js/commit/5d2d242f656103ac38086d6b26433a09f1c38c75"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Marak/colors.js/commit/6bc50e79eeaa1d87369bb3e7e608ebed18c5cf26"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Marak/colors.js"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-10T17:29:22Z",
    "nvd_published_at" : null
  }
}