Crazy amount of guests

This goes against the open, anonymous foundation of the internet, where many web services are expected to respond without any authentication first.
It does but it has become a matter of self defense, thanks to the AI bros.

Blindly taking a cookie reported by the client without validating it is a stupid shortcut from the days of trustworthiness in the good nature of the internet, not an effective control.
Absolutely. Sadly it is uncritically promoted as the best invention since sliced bread by a lot of those in this thread who use and promote Cloudflare. To be fair: While it is neither trustworthy nor safe it is probably better than nothing as long as the bots do not figure out how easy it is to fake and as long as there is no built in support from XF for a better solution (which won't happen, judging from the statements by @Chris D further up) or a 3rd party it is as good as you can get with a decoupled filter. This is one of the reasons why I like the approach of IP Threat Manager despite the obvious architectural downsides.
As long as the bots do not specifically target XF as a platform but scrape rather generically the probably won't bother to fake this cookie.
 
In the realm of nginx front-to-back configuration, the option of using the subrequest authentication (auth_request) does exist. However, I've not gone to the extent of implementing that... yet. Might be a good weekend project.
We actually use auth_request where we run Anubis to allow it to be dropped in and out as required. It does in that case of course mean the Anubis install isn't as optimised as it could be to the target site.
It would require some form of custom code between a WAF and the backend machine to efficiently communicate session legitimacy when it comes to cookie validation.
You could use a signed token instead, ie something like a JWT then a WAF layer can authenticate that without a round trip to the database/XF layer if it has the same secret. Beyond the csrf cookie however and user cookie there are no sessions to speak for 'new' connections (I thought?), the session cookie is only set once a user is logged in.

Th initial communication will always be "out of the blue" however unless you go for a members only approach (although even then you have to serve enough to allow them to perform the authentication). I do think some work on abnormal user analysis will probably be useful for the future since scraping is bound to move towards authenticated users in the future and assuming the registrations are done either via humans or decent AIs and via proxies I expect filtering out those users at registration will get progressively harder. I remember years back when admins on various sites we'd host would call to say they had hundreds of registrations they needed to go through, obviously these days we do try to automate and weed out the worst!

As long as the bots do not specifically target XF as a platform but scrape rather generically the probably won't bother to fake this cookie.
Quite, checking it is just a quick way of culling down the connections that need scrutiny. I think it would be nice/useful if it could be validated outside of XF (well and it could be the data is in the DB if you want it), but the cost of doing any of these validations has to be less than the cost of serving the request ultimately (although the bots grind my gears and it does almost become a matter of principle to stop them!). Signing the cookie data would seem like the obvious way of doing that then if you're using CF or something you could (not a big CF user so I may be wrong) use a CF worker or similar maybe to check the signature and make the check more robust than just a "present/absent".

Ultimately I don't see a way of blocking these cheaply other than looking for clues in the connection and as noted upthread the key for that is probably the tcp timing vs the tls timing (the former being to the proxy and the latter (most likely) being to the actor) and if they differ significantly you can be fairly sure the actor is behind a proxy. Indeed this seems to be the main mooted "solution" out there. There are a few nginx hacks to expose enough of the data to be useful, but I've not seen a clean off the shelf open source solution using this yet. Combine that with RBLs of those IPs and you might have some kind of solution (until the proxy providers and actors decide they are happy with the traffic being MITM'd by the proxy). However I expect there will be a good amount of fallout. There simply isn't that much data up front when a new connection is made. At present yes they tend to re-use user agents, but it'd be trivial to add some random noise in there and to shore that up. There are sometimes discrepancies in the TLS connection to identify non-browser clients, but again that's again down to sloppiness on their part, sometimes patterns in the scraping once more just lack of effort from them. All those clues can be cleaned up. So you're left with an HTTP request that looks 100% legitimate and the only "tell" you have is that you're getting a lot more of them than you'd expect.

Absolutely. Talking about how to fight bots in a forum that gets constantly scraped by 2-4.000 of exactly these bots to feed an AI seems not to be most clever idea.
Indeed.
 
I challenged Hetzner recently as so much dodgy stuff coming from there. Since doing that a new cf verified bot appeared. PoliasBot. Declares itself, described as a search engine. Couldn't find more about it, but Claude eventually found it was a search engine that sells its data to AI. It was behaving aggressively so added to robots.txt (which it says it respects in Cloudflare).

So one more for robots.txt if anyone is interested. It's very new apparently.
 
Combine that with RBLs of those IPs and you might have some kind of solution (until the proxy providers and actors decide they are happy with the traffic being MITM'd by the proxy)
I should have also noted that it wouldn't be a "good" solution because you have issues like CGNAT and even multiple home users behind the same IP. A compromised TV or phone doing proxying might take out an IP address being used by many legitimate users if combining such flags into RBLs (for speed).
 
I should have also noted that it wouldn't be a "good" solution because you have issues like CGNAT and even multiple home users behind the same IP.
I do sometimes have the occurence that multiple of my users are using the same IP at the same time b/c they are using public transport, randomly sitting in the same train and use the train's internet connection, not knowing of each other. :D
 
You could use a signed token
Hmmmm, there's an idea: at logon, user gets a cookie with the username, a timestamp, but also a digital signature taking the user and timestamp as seeds through a private key on server. Then a CF filter can check if the signature checks out based on the user and timestamp in the cookie and the public key stored in CF. No query to server needed, could let all validated forum members bypass all filtering rules.

Maybe implement a date-based choice of rotating private/public keys every month and you're set.
 
Hmmmm, there's an idea: at logon, user gets a cookie with the username, a timestamp, but also a digital signature taking the user and timestamp as seeds through a private key on server. Then a CF filter can check if the signature checks out based on the user and timestamp in the cookie and the public key stored in CF. No query to server needed, could let all validated forum members bypass all filtering rules.

Maybe implement a date-based choice of rotating private/public keys every month and you're set.
That'd be an interesting take actually. Definitely an avenue to consider/explore.
 
Back
Top Bottom