From eb863321990e7e5514aa14f68b8d9978ece9e65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Kukawski?= Date: Thu, 27 May 2021 08:46:30 +0200 Subject: [PATCH] Prevent ReDos issue with regex inside gopher_parsedir (#446) --- src/php/net-gopher/gopher_parsedir.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/php/net-gopher/gopher_parsedir.js b/src/php/net-gopher/gopher_parsedir.js index ac9a32c3d0..48cf9a5437 100644 --- a/src/php/net-gopher/gopher_parsedir.js +++ b/src/php/net-gopher/gopher_parsedir.js @@ -22,7 +22,7 @@ module.exports = function gopher_parsedir (dirent) { // eslint-disable-line came * s = Audio file format, primarily a WAV file */ - const entryPattern = /^(.)(.*?)\t(.*?)\t(.*?)\t(.*?)\u000d\u000a$/ + const entryPattern = /^(.)([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\r\n$/ const entry = dirent.match(entryPattern) if (entry === null) {