←back to thread

550 points polskibus | 4 comments | | HN request time: 0s | source
Show context
mholt ◴[] No.19117116[source]
A few days ago [1], I found this filter for UBlock Origin to be working for me so far:

    facebook.com##[id^=hyperfeed_story_id_]:has([id*=feed_sub_title_]):has(span:has-text(/S.*p.*o.*n.*s.*o.*r.*e.*d/))
GitHub issue: https://github.com/uBlockOrigin/uAssets/issues/3367

[1]: https://twitter.com/mholt6/status/1092191140168622080

replies(1): >>19117313 #
1. testplzignore ◴[] No.19117313[source]
If I worked at Facebook and was evil, I'd put some text in that span that caused catastrophic backtracking :)
replies(1): >>19117514 #
2. majewsky ◴[] No.19117514[source]
Regexes can be evaluated in linear time, so you'd have to send gigabytes worth of text to cause any noticeable slowdown.
replies(1): >>19119787 #
3. MapleWalnut ◴[] No.19119787[source]
I believe with lookahead/behind a regex is technically not "regular" anymore, so you can definitely DoS a regex without GB worth of text.
replies(1): >>19119973 #
4. saagarjha ◴[] No.19119973{3}[source]
Sure, but that regex doesn't have lookahead/lookbehind?