GHSA-5rqg-jm4f-cqx7: Colors Denial of Service Vulnerability
HIGHGHSA-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
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.
npm install colors@Latest secure release
npm install colors@Latest secure release
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
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?
Which Colors versions are affected?
What version fixes GHSA-5rqg-jm4f-cqx7?
Is colors affected?
What CWE is associated with GHSA-5rqg-jm4f-cqx7?
How can I check npm dependencies for GHSA-5rqg-jm4f-cqx7?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}