Let’s End Credential Stuffing Breaches
If you’re responsible for protecting user data on a web application or SaaS service, this article is mandatory reading.
What do each of these websites have in common?
They, and more importantly their customers, all needlessly suffered Credential Stuffing breaches in 2023-2024. At least one of these companies - the one you’d think might have the best security measures in place - had the gall to blame their own customers. There is at least one class action lawsuit in the works.
The kicker? A single, simple, and free security measure would have prevented these breaches.
The hard fact is Credential Stuffing breaches should’ve ended in 2017, if not before.?
Individual users - it’s also easy to protect yourself!
So many more suggestions here, but it’s beyond the focus of this article.
Let’s take a look at what Credential Stuffing really is.
In short: Bad actors take known-to-be-used credentials and “stuff” them into login forms on other websites, in hope that the same username and/or password is used across multiple websites.?
Over the years, the bad actors:
The end result are massive lists of usernames and passwords that are known to be used on the internet. How massive? Over a billion. And they just keep coming. It’s relentless. In the last couple weeks we’ve seen the massive Naz.API Credential Stuffing List and what's being called “the mother of all breaches”, with 26 billion records (not all unique).
Here’s an ultra-simplified sample:
+------—------—------—---+
| sam | password |
| sally | password! |
| steve | password123 |
| sue | Password123$ |
+------—------—------—---+
Come on now - who hasn’t used ‘password’ at some point? Who could blame you - it was the default password for enterprise gear for decades. The tech industry has taken forever to come around to Secure by Default.
These datasets can be usernames only, passwords only, or both. They can contain email and other attributes as well.
So the bad actors have a bunch of credentials. Now what?
The key is these credentials are known to have been used before. So they “stuff” those credentials into login forms on other websites in order to brute-force into other peoples’ accounts, with surprisingly successful results. This works for a couple reasons:
Bad actors mix and match usernames and passwords using every possible combination. If a login form unintentionally leaks that a username is in use, then half of the equation has been solved - only the password remains.
They may try to fly under the radar, at least for a while, but eventually they’ll unleash an army of bots. Your site may see hundreds, thousands, or millions of login attempts per minute.
They could utilize anything from a solitary computer to hundreds, thousands, or even millions of bots. Authentication requests will be distributed amongst their fleet to optimize their campaign for best possible results. They can scale up or down, adding as many bots as they deem necessary to get their payday.?
Your site may slow to a crawl.
You would expect that this excessive authentication activity should trigger alerts. At the very least, you would think someone would be watching metrics and logs for anomalies and notice. Based on the plethora of Credential Stuffing breaches in the news, apparently not. And that seems like a dereliction of duty.
So, how do we stop these attacks?
SIMPLE! Don’t allow logins for breached passwords.
领英推荐
As mentioned at the beginning, this was solved for us in 2017:
NIST guidance is to check the passwords against breach corpuses at the establish and change steps, but going a step beyond and checking at the login step is what actually prevents Credential Stuffing attacks. With new breach dumps being released frequently, a password could change from “secure” to “known-compromised” from one day to the next. So a password you allowed someone to create last month could no longer be safe.
Let’s dig in!?
As we touched on above, these compromised passwords are already known as these breach databases are shared underground.
Since we can use the same breach dump databases as our adversaries, we simply add a step to the user/password verification process that checks if the password is compromised.
Only a small bit of logic needs to be added to the login procedure - and no more Credential Stuffing breaches! ?
Here’s what this login process would look like:
The “Check Password in Breach DB” step can be done with a locally-saved breach database (free) or via remote API call (very nominal fee). The remote API calls are secured with k-anonymity - no shooting users’ passwords all over the internet. Remote API call fails because of an outage? Your call whether to fail open or fail closed - it’s sometimes a delicate balance between data protection and end-user frustration. Aside from HIBP, there are many other options on the market to check against compromised password databases these days.
Our job is done, right?
Our jobs is never done. This shouldn’t be your only line of defense. This is a cat-and-mouse game, so hackers could have newer passwords than we do. The 80/20 rule applies here - and I’d dare say this is the 1 thing that yields 99+% protection against Credential Stuffing. But we can do more!
Here are some other mitigation techniques to protect against Credential Stuffing other nuanced brute-force website authentication attacks, including password spraying (slow, targeted attack against a smaller number of known high-value accounts):
5 failures in 5 minutes
10 failures in 20 minutes
20 failures in 24 hours
40 failures in 7 days
1) multiple “invalid username” login attempts
2) multiple failed login attempts
Use different durations based on thresholds around attempt timing/volume, leading up to a permanent block of the IP address, especially for multiple infractions. To be on the safer side, consider only blocking IP addresses without a history of successful user logins.
The tips above and suggested thresholds will need to be tailored to your service and customer base. Implementing just these delay and blocking countermeasures by themselves - even without blocking compromised passwords - will thwart most credential stuffing attacks. The key takeaway with these is: the more stumbling blocks you put in the way, the sooner bad actors go elsewhere looking for easier prey.
Wrapping up...
Everything so far in this article suggestions can be implemented for free, or very little cost - and some engineering time. Some paid options worth considering include Bot Management services, Web Application Firewalls, and API Gateways.
Of course the overall security of your web application is subject to its weakest link. Make sure it’s hardened to modern standards with a holistic application security program, including regular vulnerability and penetration testing. Here are a couple starting points:
By proactively implementing the simple yet effective security measures outlined in this article, we can strengthen our defenses - and with any luck - put an end to credential stuffing breaches!
6+ Years fighting fraud | Girl Dad x2 | Fraud Protection, Payments, Identity & Returns
1 年Great post, couldn't agree more this has been a PR nightmare for 23andMe. There are many layers that business can take Including dedicated layers for #botmanagement
Founder of SecureLabs | Helping businesses put security, privacy, and operations systems in place | ?? Keynote, Moderator & Speaker | Identity Theft & Cyber Safety Expert | Volunteer | Wife + Mama
1 年Great article, Dan Daffer! Insightful and actionable. Thanks for putting this together!