Skip to content

Commit

Permalink
Prevent ReDos issue with regex inside gopher_parsedir (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
kukawski committed May 27, 2021
1 parent 243b723 commit eb86332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/php/net-gopher/gopher_parsedir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eb86332

Please sign in to comment.