Photo by Max van den Oetelaar on Unsplash
Credential stuffing is a brute-force attack on a services’ user accounts. Not one specific account, but many. Typically by using credentials that were found in other hacks. As a user, you can see via haveibeenpawned.com if one of your accounts was compromised. Most likely, it was. Let’s learn what you can do!
Why you should care
- Credential Stuffing is part of “Broken Authentication” and thus #2 in the OWASP Top 10 (source)
- 2020: $3.5 million in fraudulent check withdrawals with credential stuffing (more details)
- 2020: About 500,000 Zoom users credentials were found with credential stuffing (source)
- 2020: “Retail, travel, and hospitality industries attracted a startling 63% of credential stuffing attacks” according to Akamai.
- 2021: AVM (FritzBox) registers a lot of credential stuffing attacks (source)
How does a credential stuffing attack work?
- The attacker gets a list of valid credentials, e.g. (username, password) for millions of people. There are many leaks.
- The attacker tries them on big services (Gmail, Facebook, Twitter, Banks, Reddit, …)
That’s it. It’s really trivial. Credential stuffing does not target you personally, but a lot of people at the same time. But that doesn’t help you when your bank account is empty at the end of the day, does it?
How can I defend against a credential stuffing attack?
As a user, there are two perfect defense measures:
- Strong Passwords: Good passwords might look different than you think. But it’s easy to generate memorizable strong passwords.
- Unique Passwords: Don’t share passwords among services. Never.
To fulfill both in a convenient way, you should use a password manager. A third point that helps is to use multi-factor authentication (MFA). Having at least a second factor (2FA) goes a long way. However, the attacker most likely learns which passwords are correct and can work on breaking the second factor, e.g. by SIM swapping.
As a service provider, the defenses are not perfect and more complicated:
- Rate Limiting: If a single IP makes too many invalid password attempts, slow that IP down. For example, ask them to solve a CAPTCHA first. Or tell them that they are not allowed to log in for the next 30 seconds. Just be aware that this could also block valid users, e.g. at schools or other bigger open networks.
- Web Application Firewalls (WAF): Full disclaimer here: I don’t have practical experience here. I’ve heard about “Proactive Bot Defense” which might be interesting for other attack scenarios as well. However, it certainly also has the issues to detect all attacks (False-Negatives) and to block only attacks (False-Positives).
- Two-factor authentication (2FA): Forcing the user to use a second factor makes it a lot less likely that credential stuffing works, even if the user shared passwords with a vulnerable service and even when the password is weak.
- Single-Sign-On (SSO): Letting another service handle the authentication side-steps all of those hassles. One variant which is well-known is “social login”. That is simply SSO by big social websites like Facebook, Twitter, Github, or LinkedIn.
- Check users' passwords for breaches: haveibeenpawned allows you to check if credential combinations are in a breach.
There are also some specific points to make the life of bot-developers harder, e.g. requiring JavaScript, blocking headless browsers, or blocking traffic from AWS. Jarrod Overson has written a very nice article about this:
More in this series
In this series about application security (AppSec), we already explained some of the techniques of the attackers π and also techniques of the defenders π:
- Part 1: SQL Injections ππ
- Part 2: Don’t leak Secrets π
- Part 3: Cross-Site Scripting (XSS) ππ
- Part 4: Password Hashing π
- Part 5: ZIP Bombs π
- Part 6: CAPTCHA π
- Part 7: Email Spoofing π
- Part 8: Software Composition Analysis (SCA) π
- Part 9: XXE attacks ππ
- Part 10: Effective Access Control π
- Part 11: DOS via a Billion Laughs π
- Part 12: Full Disk Encryption π
- Part 13: Insecure Deserialization ππ
- Part 14: Docker Security π
- Part 15: Credential Stuffing ππ
- Part 16: Multi-Factor Authentication (MFA/2FA) π
- Part 17: ReDoS π
The following articles are about to come:
- Part 18: Secure Messaging π
- Part 19: Cryptojacking π
- Part 20: Backups π
- Part 21: Cryptotrojans π
- Part 22: Single-Sign-On π
- Part 23: Clipboard Hijacking π
- Part 24: Certificates π
- Part 25: Race Condition Attacks in Blockchains π
- Part 26: Mobile Device Management (MDM) π
- Part 27: Server-Side Request Forgery (SSRF) π
- Part 28: Network Separation π
- Part 29: Social Engineering (including Phishing) π
- Part 30: Virtual Private Networks (VPNs) π
- Part 31: CSRF π
Let me know if you are interested in more articles around AppSec / InfoSec!