git-urls
git-urls copied to clipboard
Limit ReDOS by checking the length before running the regexp.
Go doesn't support look-ahead assertions so I did this out of the regexp.
This attempts to address CVE-2023-46402 and #24
LGTM
Tagging previous commiter for attention. @whilp @alokmenghrajani @isaaguilar Would it be possible to merge the PR and create a new release tag.
I implemented something similar (see https://github.com/whilp/git-urls/pull/27) except I made my max len 8000, and it is still very performant.