-
-
Notifications
You must be signed in to change notification settings - Fork 956
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 domain parsing with custom psl list and removing false positives #84452
Conversation
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…shing-detect into feat/add-domain-parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for making that change
This PR introduces a major improvement to the
test-lists.ts
file which is critical for preventing false positives within CICD.Rationale
Previously, we've been allowing subdomains to bypass the
tranco
check because we were not parsing the domain within this test. Thereforeauth.magic.link !== magic.link
even thoughmagic.link
is on thetranco
list and this subdomain is owned by the same company. This has been the source of widespread impact false positives being merged into this repo, and this PR will reduce future cases of the problem. (with the assumption that the tranco list stays up to date so that it contains future popular websites).As you can see from the websites I removed in
config.json
includingberkeley.edu, bitcoin.com, consensys.net
and others, this does a very good job at detecting false positives correctly.Extending public suffix list
The change that enables this change is the
custom-tlds.ts
file which now extends public suffix list with suspected hosting providers that do NOT exist on PSL already. This may be annoying to keep up to date, but is necessary to do because PSL is slow to update and there are lots of hosting providers that allow you to host malicious websites. Unfortunately, these hosting providers have a high enough tranco score so they may cause the CICD to fail.To remedy this you have 2 options:
config.json
uses this domain, you can just add the hostname to the bypass list insidetest-lists.ts
custom-tlds.ts
file.To debug the above, I recommend the following code snippet (or CTRL+F 😉 )