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

add shady link regex for check url with ips #260

Merged
merged 5 commits into from
May 6, 2024

Conversation

sairuss7
Copy link
Contributor

@sairuss7 sairuss7 commented Apr 22, 2024

resolve #260

@PierreDemailly
Copy link
Member

Hi @sairuss7 thanks for contributing 👍

Could not we use simpler regexp? Maybe with the addition of a new constant kShadyLinkExcludeRegExpp to exclude local IPs (if needed, just an idea)

Moreover please add unit tests (test/probes/isLiteral.spec.js) and update the docs which only refer to suspicious extensions, we should add that it checks for IPs domains.

@jean-michelet
Copy link
Contributor

Could not we use simpler regexp?

Developing high-quality regexps requires a great amount of rigor, so I think we should refer to an official recommendation.

@sairuss7
Copy link
Contributor Author

sairuss7 commented Apr 22, 2024

@PierreDemailly Thanks for the feedback Pierre okay I'll do it better, but for simplifying the regex, I don't really have an idea. Maybe I can do it with a tool.

@fraxken
Copy link
Member

fraxken commented Apr 25, 2024

RegExp seems ok to me, but we should add new tests on the probe at least

src/probes/isLiteral.js Outdated Show resolved Hide resolved
@sairuss7 sairuss7 requested a review from fraxken May 5, 2024 22:43
@fraxken fraxken merged commit 9a9cdae into NodeSecure:master May 6, 2024
8 checks passed
@fraxken
Copy link
Member

fraxken commented May 6, 2024

@allcontributors please add @sairuss7 for code

Copy link
Contributor

@fraxken

I've put up a pull request to add @sairuss7! 🎉

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.

4 participants