From 08b4b0262478cf0951dc8cdb5554b6b523366914 Mon Sep 17 00:00:00 2001 From: Sushant Mittal Date: Thu, 14 Jul 2022 16:09:30 +0530 Subject: [PATCH] Fixed ReDoS in 'loadAnnotation' function of previous-map.js. --- src/previous-map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/previous-map.js b/src/previous-map.js index ffc1f79..2e41f8d 100644 --- a/src/previous-map.js +++ b/src/previous-map.js @@ -31,7 +31,7 @@ export default class PreviousMap { } loadAnnotation(css) { - let match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//); + let match = css.match(/\/\*\s*# sourceMappingURL=((?:(?!sourceMappingURL=).)*)\s*\*\//); if ( match ) this.annotation = match[1].trim(); }