skills/security-compliance/account-security/SKILL.md
Protect customer accounts with brute-force lockouts, multi-factor authentication, secure session handling, and credential-stuffing defenses
npx skillsauth add finsilabs/awesome-ecommerce-skills account-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Customer accounts hold saved payment methods, loyalty points, purchase history, and shipping addresses — making them high-value targets for credential-stuffing attacks and account takeovers. Effective account security layers brute-force protection on the login page, breach-exposed password detection, optional multi-factor authentication (MFA), and anomaly detection for account takeover patterns. The right approach depends heavily on your platform — Shopify manages most security controls at the platform level, while WooCommerce requires additional plugins.
| Platform | What the Platform Handles | What You Need to Configure | |----------|--------------------------|---------------------------| | Shopify | SSL/TLS, brute-force protection on login, PCI compliance, server-side security | Customer account settings, whether to require phone verification, Social login apps for Google/Apple sign-in | | WooCommerce | Basic login form only | Install Wordfence (free) for brute-force protection, limit login attempts, 2FA, and login security monitoring | | BigCommerce | SSL/TLS, platform-managed account security, basic brute-force protection | Two-factor authentication for admin users; customer-facing 2FA requires an app | | Custom / Headless | Nothing — you build all security controls | Rate limiting, password hashing, MFA, session management, ATO detection |
Shopify handles the majority of customer account security at the platform level — you do not manage SSL, brute-force detection, or password hashing yourself.
Enable new customer accounts (passwordless login): Shopify offers two account experiences:
Switching to new customer accounts (passwordless) eliminates the most common attack vectors: credential stuffing and brute force.
Two-step verification for admin accounts:
Social login (Google/Facebook/Apple): Install a social login app from the Shopify App Store:
Detecting suspicious customer activity: Shopify does not expose customer login events for programmatic monitoring. For advanced monitoring, use Shopify's Fraud analysis in orders to detect account takeovers combined with fraudulent purchases.
WooCommerce's built-in login form has no rate limiting, MFA, or advanced security. You must add these via plugins.
Install Wordfence Security (free, recommended):
Limit Login Attempts Reloaded (free alternative for just rate limiting):
Customer-facing 2FA:
Social login for WooCommerce: Install Nextend Social Login (free/premium) — supports Google, Facebook, Apple, and Twitter/X sign-in on WooCommerce login and registration pages.
Compromised password detection: Install WPassword or implement a custom check against the HaveIBeenPwned API during registration and password changes.
Admin two-factor authentication:
Customer account security: BigCommerce does not expose customer-facing 2FA natively. Options:
Google/Social sign-in for BigCommerce: Integrate via BigCommerce's customer login API with a social identity provider. Auth0 provides a turnkey solution with a BigCommerce integration.
For custom storefronts, implement security controls at each layer.
Rate limiting on the login endpoint:
import { Ratelimit } from '@upstash/ratelimit';
import { Redis } from '@upstash/redis';
const redis = Redis.fromEnv();
const ipLimiter = new Ratelimit({ redis, limiter: Ratelimit.slidingWindow(20, '15 m'), prefix: 'rl_login_ip' });
const accountLimiter = new Ratelimit({ redis, limiter: Ratelimit.slidingWindow(5, '15 m'), prefix: 'rl_login_email' });
export async function checkLoginRateLimit(ip: string, email: string) {
const [ipResult, accountResult] = await Promise.all([
ipLimiter.limit(ip),
accountLimiter.limit(email.toLowerCase()),
]);
if (!ipResult.success) throw new Error('TOO_MANY_REQUESTS_IP');
if (!accountResult.success) throw new Error('ACCOUNT_TEMPORARILY_LOCKED');
}
Secure password hashing (Argon2id):
import { hash, verify } from 'argon2';
export const hashPassword = (password: string) =>
hash(password, { type: 2 /* argon2id */, memoryCost: 65536, timeCost: 3, parallelism: 4 });
export const verifyPassword = (storedHash: string, password: string) =>
verify(storedHash, password);
TOTP-based MFA:
import { authenticator } from 'otplib';
export function generateMFASecret(): string {
return authenticator.generateSecret(32);
}
export function verifyTOTP(secret: string, token: string): boolean {
authenticator.options = { window: 1 }; // Allow ±30-second drift only
return authenticator.verify({ token, secret });
}
Secure session cookies:
// Set session cookies with httpOnly, Secure, SameSite=Strict
response.cookies.set('session_token', token, {
httpOnly: true, // Not accessible to JavaScript — prevents XSS theft
secure: true, // HTTPS only
sameSite: 'strict', // CSRF protection
maxAge: 30 * 24 * 60 * 60,
path: '/',
});
Send security alert emails for sensitive account changes: Always notify customers via email when:
| Problem | Solution |
|---------|----------|
| WooCommerce login has no rate limiting | Install Wordfence or Limit Login Attempts Reloaded immediately on any live WooCommerce site |
| Admin account compromised via credential stuffing | Enable 2FA for all admin users; use strong, unique passwords for each admin; never reuse admin credentials across services |
| TOTP codes working indefinitely (custom builds) | Use window: 1 in otplib to accept only ±30-second drift; never accept codes older than 90 seconds |
| Refresh token stored in localStorage | Store refresh tokens in httpOnly cookies only; localStorage is accessible to JavaScript and vulnerable to XSS |
| Rate limit bypass by rotating email variations | Normalize email addresses (lowercase, strip + aliases before the @) before applying per-account rate limiting |
tools
Let shoppers save products to a wishlist, share it with friends, and get notified when saved items come back in stock or drop in price
development
Build a themeable storefront with design tokens and CSS custom properties that supports white-labeling, multi-brand variants, and dark mode
development
Speed up product discovery with instant search suggestions, fuzzy typo matching, and category-aware results powered by Algolia or Elasticsearch
development
Build a mobile-first storefront with thumb-friendly navigation, sticky add-to-cart buttons, and touch-optimized components for high mobile conversion