If you build or maintain systems for a small business, multi-factor authentication (MFA) is the single highest-leverage security control you can ship. The Verizon 2026 DBIR found that 81% of breaches involve stolen or weak passwords — and MFA neutralizes most of those attacks even when credentials leak.
Here's the developer's-eye view.
Why it matters
Passwords fail because people reuse them. When a third-party service gets breached, attackers run credential-stuffing against your login endpoint. MFA adds a second factor that makes automated attacks economically pointless. IBM's Cost of a Data Breach 2026 report showed SMBs with MFA on all accounts cut breach costs by 67%.
Pick the right factor
| MFA Type | Security | Cost | Best for |
|---|---|---|---|
| SMS codes | Low | Free | Fallback only |
| TOTP apps | Good | Free | Most SMB accounts |
| Push notifications | Good | £2-5/user/mo | Simple approval flows |
| Hardware keys (FIDO2) | High | £25-50 once | Admin & financial access |
| Passkeys (multi-device FIDO) | Highest | Free | Passwordless future |
Skip SMS as a primary factor — NIST SP 800-63B no longer recommends it thanks to SIM-swap attacks (the UK NCSC logged a 340% jump in 2025).
TOTP is the sweet spot
Time-based one-time passwords work offline, cost nothing, and are trivial to integrate. If you're on Node, most of the work is one library:
import { authenticator } from 'otplib';
// Generate a per-user secret at enrollment
const secret = authenticator.generateSecret();
// Build the otpauth:// URI for the QR code
const uri = authenticator.keyuri(user.email, 'YourApp', secret);
// Verify the 6-digit code on login
const isValid = authenticator.verify({ token, secret });
Store secret encrypted at rest, render uri as a QR code (Google Authenticator, Authy, 2FAS all scan it), and gate the session on isValid.
Common pitfalls
- No backup codes → users get locked out and disable MFA.
- Verifying tokens without a replay window or rate limit.
- Storing TOTP secrets in plaintext.
- Treating SMS as your primary factor.
For anything privileged — admin panels, payment systems — step up to FIDO2/WebAuthn hardware keys. They're phishing-resistant in a way TOTP isn't.
Ship MFA before you ship the next feature. It's the cheapest security win you'll get all year.
Originally published on strongpassfactory.com
Top comments (0)