DEV Community

Cover image for Weak Password Policies + No Rate Limiting: The Account Takeover Crisis in E-Commerce
Abhinav Singwal
Abhinav Singwal

Posted on

Weak Password Policies + No Rate Limiting: The Account Takeover Crisis in E-Commerce

The Problem

Most shopping websites allow users to set passwords like password123 or admin. At the same time, they do not limit how many login attempts can be made per minute. This combination creates a critical vulnerability: attackers can try thousands of password guesses per hour until they find the correct one.

Account takeover via brute force is not theoretical. It happens daily across small and medium e-commerce stores. The result is stolen payment information, fraudulent orders, and angry customers who blame the merchant.

If your shopping website allows unlimited login attempts and accepts weak passwords, your customer accounts are essentially unprotected.


How Attackers Exploit This Combination

The exploitation process follows a simple, automated workflow:

  1. The attacker obtains a list of email addresses. These may come from previous data breaches, OSINT, or simple guessing.
  2. The attacker uses a tool like Hydra, Burp Suite Intruder, or a custom Python script to send login requests.
  3. The tool cycles through the top 1000 most common passwords against each email address.
  4. Because there is no rate limiting, all 1000 attempts complete in minutes.
  5. Because the password policy is weak, common passwords like qwerty123 or welcome are actually valid.

Within hours, the attacker compromises dozens or hundreds of accounts.


Real-World Attack Scenarios on Shopping Sites

The following attack vectors are common in e-commerce environments:

Customer Account Brute Force

An attacker targets a list of customer email addresses. Upon successful login, the attacker gains access to saved credit cards, shipping addresses, order history, and stored gift cards. This data can be used for identity theft or direct financial fraud.

Admin Account Brute Force

Many shopping platforms use predictable admin panel URLs like /admin or /administrator. Attackers attempt common credentials such as admin:password, admin:admin, or storename:storename. A compromised admin account allows the attacker to issue mass refunds, download the entire customer database, or deface the website.

Gift Card and Loyalty Point Brute Force

If a shopping website allows unlimited balance checks on gift card numbers or loyalty accounts, attackers can brute force valid numbers. Predictable gift card code patterns worsen this risk.

Coupon Code Brute Force

Attackers can discover active discount codes by brute forcing common patterns such as SAVE10, SAVE20, WELCOME15, or SUMMER2024. This leads to revenue loss and promotion abuse.


Why E-Commerce Platforms Are Particularly Vulnerable

Shopping websites have unique characteristics that make them more susceptible to this vulnerability than banks or social media platforms.

Frictionless Checkout Priority

E-commerce businesses prioritize speed. Adding CAPTCHA or login delays is seen as hurting conversion rates. Security is often deprioritized until a breach occurs.

Reliance on Payment Processors

Many merchants assume the payment gateway handles all fraud prevention. Payment processors monitor transaction fraud, not login attempts. The login system is entirely the merchant's responsibility.

Use of Insecure Templates

Small to medium stores frequently use unmodified open-source platforms or cheap templates. These often ship with default password policies and no rate limiting configured.

Third-Party Account Integration

Shopping websites that allow social login still maintain traditional login endpoints. Attackers target the weaker traditional endpoint.


Step-by-Step Testing Methodology

You should test your own website responsibly. The following methodology assumes you have permission to test.

Step 1: Assess Password Policy

Attempt to register or change a password using these values:

  • password
  • 123456
  • qwerty
  • a
  • aaaaaaaa
  • password123
  • No numbers or symbols only

If any of these are accepted, your policy is weak.

Step 2: Test for Rate Limiting

Send 100 consecutive login requests with incorrect credentials to the same account. Use a simple bash loop or a tool like Burp Suite Intruder.

for i in {1..100}; do
  curl -X POST https://yourstore.com/login \
    -H "Content-Type: application/json" \
    -d '{"email":"victim@example.com","password":"wrongpassword"}'
  sleep 0.1
done
Enter fullscreen mode Exit fullscreen mode

If all 100 requests return the same response (e.g., invalid credentials), there is no rate limiting.

Step 3: Check for Account Lockout

After 10 to 20 failed attempts, the account should lock temporarily. If you can still attempt logins after 50 attempts without any lockout message, lockout is absent.

Step 4: Test IP-Based vs User-Based Rate Limiting

Repeat the 100 attempts from a different IP address. If the second IP can also attempt 100 times without delay, rate limiting is missing entirely.


Sample Proof of Concept

The following Python script demonstrates a minimal brute force test. This is for authorized security testing only.

import requests
import time

target_email = "customer@example.com"
password_list = ["password", "123456", "qwerty", "admin", "welcome", "password123"]

url = "https://target-shop.com/api/login"

for password in password_list:
    response = requests.post(url, json={"email": target_email, "password": password})
    print(f"Trying {password}: {response.status_code}")
    if response.status_code == 200:
        print(f"Success! Password is {password}")
        break
    time.sleep(0.1)  # Minimal delay, often ineffective
Enter fullscreen mode Exit fullscreen mode

On a vulnerable site, this script finds a valid password within seconds.


Business Impact: Beyond the Hype

The impact of brute force account takeover on a shopping website includes the following business consequences.

Financial Loss from Fraudulent Orders

Compromised accounts are used to place orders using saved payment methods. The original customer disputes the charge. The merchant absorbs chargeback fees, product loss, and payment processor penalties.

Customer Churn and Reputation Damage

News of a breach spreads quickly on social media and review platforms. Customers lose trust and move to competitors. Small merchants rarely recover their reputation after a publicized account takeover incident.

Support Overload

After a breach, customer support teams receive hundreds of password reset requests and fraud reports. This strains limited support resources.

Legal and Compliance Exposure

Data breach notification laws may require the merchant to disclose the incident to affected customers and regulators. Failure to disclose leads to fines.

Gift Card and Loyalty Point Theft

If gift card balances are accessible via login, attackers drain stored value. The merchant must reissue funds or face customer lawsuits.


How to Fix It: Actionable Recommendations

Implement the following controls in order of priority.

Priority 1: Enforce a Strong Password Policy

Require a minimum of 8 characters. Require at least three of the four following character types: uppercase letters, lowercase letters, numbers, and symbols. Maintain a blocklist of the top 1000 most common passwords from breaches. Reject passwords that include the user's email prefix or common patterns.

Priority 2: Implement Rate Limiting

Allow a maximum of 5 login attempts per 15 minutes per user account. Allow a maximum of 10 login attempts per 15 minutes per IP address across all accounts. Return a standard HTTP 429 Too Many Requests response when limits are exceeded.

Priority 3: Add Progressive Delays

After 3 failed attempts, introduce a 2-second delay before allowing another attempt. After 7 failed attempts, increase the delay to 10 seconds. Delays make brute force economically unviable.

Priority 4: Implement Account Lockout

Temporarily lock the account for 15 minutes after 10 consecutive failed login attempts. Send an email alert to the account owner when lockout occurs. Require password reset after 20 cumulative failed attempts over 24 hours.

Priority 5: Add CAPTCHA

Present a CAPTCHA after 3 failed login attempts from the same IP or account. Use reCAPTCHA v3 or hCaptcha to minimize friction while blocking automation.

Priority 6: Monitor and Alert

Log all failed login attempts including timestamp, IP address, and user agent. Configure alerts for more than 10 failed attempts on a single account in 5 minutes. Review logs weekly for brute force patterns.

Top comments (0)