A Regular Expression Denial of Service (ReDoS) vulnerability has been identified in dayjs/src/constant.js dayjs/src/plugin/localizedFormat/utils.js.
The regular expression /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g /(\[[^\]]+])|(MMMM|MM|DD|dddd)/ /(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/used in the replace() function is susceptible to catastrophic backtracking,
which can lead to excessive CPU consumption and cause the browser or Node.js environment to hang.
File: dayjs/src/constant.js dayjs/src/plugin/localizedFormat/utils.js
Link to code: https://github.com/iamkun/dayjs/blob/6e831280f010353e298c131cf54c922c5ac8fc82/src/constant.js#L30 https://github.com/iamkun/dayjs/blob/6e831280f010353e298c131cf54c922c5ac8fc82/src/plugin/localizedFormat/utils.js#L3