News for hackers. Stuff that matters.
Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by jqpabc123 on Thursday August 04, 2022 @09:54AM (#32342922)
Much, much simpler solution --- an actual time based rate limiter:

1) Include a hidden, unique token when the login screen is served to client.

2) On the client, enforce a minimum 3 sec delay from time of screen load before the login will be submitted with the hidden token included.

3) On the server, if the hidden token isn't returned or is unknown/not found or if the delay from the time of issue is less than 3 sec., then reject the login and optionally ban the IP address after too many failed attempts.

The 3 sec delay is more than enough to discourage/prevent brute force attacks but not enough to annoy legitimate users.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by nneonneo on Thursday August 04, 2022 @02:54PM (#32346860)
But this is totally useless - it doesn't consume any resources of the spammer! They can just launch a large number of requests (possibly from their army of bot machines to defeat IP limiting) and have them each wait 3s while doing other nefarious things in parallel.

A PoW has at least the redeeming feature of consuming some resources for those 3s (or so...) making it self-limiting; there's only so many such computations a computer can do in parallel.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by jqpabc123 on Thursday August 04, 2022 @03:07PM (#32347001)
...it doesn't consume any resources of the spammer!

It consumes the most valuable resource in the world --- time.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by nneonneo on Thursday August 04, 2022 @03:29PM (#32347230)
But it doesn’t though! A typical laptop can easily hold tens of thousands of I/O connections open at once in your favorite async I/O environment - that number can be in the millions with careful optimizations applied. Each connection just needs a sleep(3) applied between the initial form request and the submission.

A 3 second form delay just means the difference between a spammer launching 1000000 requests and posting them immediately to your database, vs them launching 1000000 requests and posting them to your database 3 seconds later.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by jqpabc123 on Thursday August 04, 2022 @03:39PM (#32347351)
Who are we kidding here --- most likely, your server can't handle 1000000 simultaneous requests.

My servers don't have enough bandwidth for that. Most of the connections are going to get dropped one way or the other. In my case, they will be intentionally dropped as being a likely denial of service attack.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by AlexAndScripts on Friday August 05, 2022 @03:45AM (#32352963)
You don't need to keep a connection open assuming this is HTTP. Just send another request.

You're sending two requests either way, it doesn't matter that you're waiting 3s because you can just do it in parallel.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by jqpabc123 on Friday August 05, 2022 @05:49AM (#32353808)
it doesn't matter that you're waiting 3s because you can just do it in parallel.

A little math for you:

An 8 char password using only letters and numbers has roughly 1 x 10^14 permutations. Just for the sake of argument, let's assume that your server and your service provider can actually handle 1000000 simultaneous, parallel requests from 1000000 different IPs.

It can't unless you're Google or Facebook running your own data centers but for the sake of argument let's just ignore that reality and push on.

To check every possible 8 character password by making 1 million parallel attempts at guessing the password every 3 seconds would take roughly 10 years. Luck being what it is, you'd probably only need to check half of them ... but that would still take 5 years.

Back in reality land, you'll be out of business before 5 years because you can't serve your paying customers. 1000000 parallel requests hitting a run of the mill server is effectively a "denial of service" attack.

In reality land using servers that I run, your 1000000 different IPs would all be banned after about 30 seconds.

Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by orheep on Thursday August 04, 2022 @11:46AM (#32344447)
Wouldn’t this exhaust the server resources with storing all the tokens? Which you would need to do significantly longer than 3 secs? Banning the IP may help but then you could just do a simple fail2ban instead?
Re:mCaptcha – Proof of work based, privacy respecting CAPTCH... by jqpabc123 on Thursday August 04, 2022 @12:59PM (#32345430)
Wouldn’t this exhaust the server resources with storing all the tokens?

Not really --- only 8 bytes per token and they can be discarded on successful login. Tokens older than X minutes or with more than X attempts can be discarded/rejected too.

How many users are legitimately attempting to log in to your server at the same time?

If you worried about this, encode the current time into the token using a hashing/encryption/checksum method of your choice. This way, everything needed to validate the attempt is submitted along with the credentials.