From d26d6a2153eec65a1525272df44cbb389d6a963a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 28 Oct 2023 12:00:18 +0100 Subject: [PATCH] fix(lib): polynomial redos --- lib/spec/openapi/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spec/openapi/utils.js b/lib/spec/openapi/utils.js index 8787efad..da135b42 100644 --- a/lib/spec/openapi/utils.js +++ b/lib/spec/openapi/utils.js @@ -88,7 +88,7 @@ function normalizeUrl (url, serverUrls, stripBasePath) { function resolveServerUrls (servers) { const resolvedUrls = [] - const findVariablesRegex = /\{(.*?)\}/gu // As for OpenAPI v3 spec url variables are named in brackets, e.g. {foo} + const findVariablesRegex = /\{([^{}]+)\}/gu // As for OpenAPI v3 spec url variables are named in brackets, e.g. {foo} servers = Array.isArray(servers) ? servers : [] for (const server of servers) {