1c9387
From 8fc20d21cd7861ecc4f034ae82234a05227c2c12 Mon Sep 17 00:00:00 2001
32c168
From: rpm-build <rpm-build>
32c168
Date: Thu, 9 Dec 2021 15:48:46 +0100
32c168
Subject: [PATCH] deps(ansi-regex): fix potential ReDoS
32c168
32c168
This is the upstream fix [1] applied to all applicable bundled deps.
32c168
32c168
[1]: https://github.com/chalk/ansi-regex/commit/8d1d7cdb586269882c4bdc1b7325d0c58c8f76f9
32c168
32c168
Fixes: CVE-2021-3807
32c168
Signed-off-by: rpm-build <rpm-build>
32c168
---
32c168
 .../node_modules/string-width/node_modules/ansi-regex/index.js  | 2 +-
32c168
 deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js    | 2 +-
63f434
 2 files changed, 2 insertions(+), 2 deletions(-)
32c168
32c168
diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js
32c168
index c4aaecf..7d32201 100644
32c168
--- a/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js
32c168
+++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js
32c168
@@ -2,7 +2,7 @@
32c168
 
32c168
 module.exports = () => {
32c168
 	const pattern = [
32c168
-		'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
32c168
+		'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
32c168
 		'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
32c168
 	].join('|');
32c168
 
32c168
diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js b/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js
32c168
index c254480..9e37ec3 100644
32c168
--- a/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js
32c168
+++ b/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js
32c168
@@ -6,7 +6,7 @@ module.exports = options => {
32c168
 	}, options);
32c168
 
32c168
 	const pattern = [
32c168
-		'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
32c168
+		'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
32c168
 		'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
32c168
 	].join('|');
32c168
 
32c168
-- 
1c9387
2.38.1
32c168