Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test Environment:
Apple M1 macbook air, 2020 (ventura 13.3.1)
node module
name : colord : v2.9
node js
version : v18.16.0
2023 Jul 10
Subject: ReDoS Vulnerability Report in the "colord" Module
Dear colord team,
I am writing to report a potential ReDoS (Regular Expression Denial of Service) vulnerability in your "colord" module. It has come to my attention that the current regex implementation for parsing hsla values in the module is susceptible to excessive backtracking, leading to potential DoS attacks.
This vulnerability can be exploited when there is an imbalance in parentheses, which results in excessive backtracking and subsequently increases the CPU load and processing time significantly. This vulnerability can be triggered using the following
Here is a simple PoC code to demonstrate the issue:
npm i colord
import { colord } from "colord";
colord( [same value as above] ).isLight();
The ReDoS vulnerability can also be reproduced on your website at https://colord.omgovich.ru/ by inserting the same input.
To mitigate this issue, I suggest modifying the regular expression as follows:
This modification adds a limit to the number of digits, thereby preventing the ReDoS vulnerability from occurring.
I believe it is crucial to address this issue promptly to ensure the security of your module for all users. Please let me know if you need any further information or assistance with this matter.