Upgrade embedded Unalix: security fixes + updated rulesets#11
Open
DigitalCyberSoft wants to merge 1 commit into
Open
Upgrade embedded Unalix: security fixes + updated rulesets#11DigitalCyberSoft wants to merge 1 commit into
DigitalCyberSoft wants to merge 1 commit into
Conversation
…used code Bundled Unalix was from Feb 2022 with known vulnerabilities and stale rules. Rules: 173 -> 206 ClearURLs providers + 72 new (unalix.json + unalix_extended.json). Removed unused HTTP client, SSL, cookies, CA bundle — bot only uses clear_url().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The embedded Unalix hasn't been touched since Feb 2022. The ClearURLs ruleset was 33 providers behind upstream, and the library had a few security issues worth fixing (ReDoS in regex compilation, broken IPv6 parsing, recursive redirect with no depth limit in clear_url()).
This upgrades the embedded copy to our maintained fork at https://github.com/DigitalCyberSoft/Unalix and trims out everything the bot doesn't use (HTTP client, SSL, cookies, CA bundle, exceptions) since it only calls clear_url().
The big win is coverage. ClearURLs rules go from 173 to 206 providers, plus two new ruleset files add another 72 providers covering stuff ClearURLs hasn't picked up yet — gbraid, wbraid, msclkid, ttclid, li_fat_id, HubSpot, MailChimp, ConvertKit, and a handful of affiliate redirect services like Slack, CJ Affiliate, and Impact Radius. The full list is in the unalix_extended.json file.
Also ships detect_homograph() and a custom rules API (rulesets_from_dict) but neither is wired into the bot — just available if you want them later.
Zero changes to main.py. clear_url() signature is backward compatible.