Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing tlds list accuratness by (?![a-z]) #67

Closed
wants to merge 1 commit into from
Closed

Increasing tlds list accuratness by (?![a-z]) #67

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 24, 2019

Thanks to that little piece of regexp code, strings like:

I'am Damian.Gathering is my favorite skill

won't be matched

@schinkowitch
Copy link

It would be great to see this merged. It fixes issue #57, which gives false positives when matching URLs.

@niftylettuce
Copy link
Collaborator

This cannot be merged, at least on the Node.js side, as is causes RE2 to error with 'invalid perl operator: (?!'. If you're not using RE2, then you are subject to CVE-2020-7661.

Since it can't be merged on the Node side, it would be super inconsistent with Browser usage.

@niftylettuce
Copy link
Collaborator

See my new package at https://github.com/niftylettuce/url-regex-safe if you want to submit a PR that solves this differently.

@niftylettuce
Copy link
Collaborator

Do either of you have time to work on implementing an alternative that doesn't use a negative lookahead/behind approach? I would award a bounty, if you submitted a patch to https://github.com/niftylettuce/url-regex-safe. It'd be great as it's parsing out stuff like foo.is from foo.istanbul.

@niftylettuce
Copy link
Collaborator

I actually found a solution, see spamscanner/spamscanner@0f57896 and the related tests I wrote (and you might want to read the comments as well).

ocavue added a commit to ocavue/url-regex-unsafe that referenced this pull request Mar 29, 2022
@ghost ghost closed this by deleting the head repository Oct 22, 2023
This pull request was closed.
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.

2 participants