Skip to content

fixes to prevent ReDoS in samplestream#61

Merged
ryndaniels merged 2 commits intomainfrom
safe-regex
Sep 5, 2025
Merged

fixes to prevent ReDoS in samplestream#61
ryndaniels merged 2 commits intomainfrom
safe-regex

Conversation

@ryndaniels
Copy link
Copy Markdown
Contributor

@ryndaniels ryndaniels commented Sep 3, 2025

As per a HackerOne report - this adds safe-regex and a check for max line length to prevent a potential ReDoS from malicious inputs/regexes when using this package. Tested locally with test data from the command line, confirmed that the new error cases both throw as expected and the options otherwise work.

@ryndaniels ryndaniels marked this pull request as ready for review September 3, 2025 12:53
@ryndaniels ryndaniels requested a review from a team as a code owner September 3, 2025 12:53
package.json Outdated
"got": "^11.8.6",
"minimist": "^1.2.8",
"parallel-stream": "^1.1.2",
"safe-regex": "^2.1.1",
Copy link
Copy Markdown

@cmaster11 cmaster11 Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm safe-regex is an unmaintained package (6yo last commit). Should we be using maybe https://github.com/fastify/safe-regex2 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - swapped for safe-regex2!

@ryndaniels ryndaniels requested a review from cmaster11 September 5, 2025 07:14
@ryndaniels ryndaniels merged commit b9c8f72 into main Sep 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants