Kembali ke indeks

LAB PASS

OTP Bruteforce Protection - Authentication - Password Reset (Per-Session Lockout)

OTP Bruteforce Protection — Authentication — Password Reset (Per-Session Lockout)

CWE-307: Improper Restriction of Excessive Authentication Attempts (per-session control PRESENT) · OWASP API2:2023 - Broken Authentication (negative test - per-session path)

Kerentanan

[PASS] OTP Bruteforce Protection - Authentication - Password Reset (Per-Session Lockout)

Deskripsi

Diuji brute-force OTP dalam satu sesi OTP tanpa meminta OTP baru.

Dampak

Tidak ada dampak pada jalur ini: lockout memicu setelah 9 percobaan (HTTP 503) sehingga brute-force per-sesi gagal.

CWE

CWE-307: Improper Restriction of Excessive Authentication Attempts (kontrol per-sesi ADA)

OWASP

API2:2023 - Broken Authentication (diuji negatif - jalur per-sesi)

Skenario

Normal: satu percobaan OTP -> Invalid. Eksploitasi: brute-force -> lockout 503 setelah 9 percobaan. PASS (kontrol per-sesi berjalan). Bypass ada di [FAIL].

Endpoint

POST http://127.0.0.1:8888/identity/api/auth/v3/check-otp

Fitur terdampak

Reset Password via OTP (crapi-identity)

Rekomendasi perbaikan

Jadikan lockout PERSISTEN per akun agar tidak dapat di-reset lewat permintaan OTP baru (lihat [FAIL] terkait).

Bukti konsep

  1. (Screenshot 1) NORMAL: POST v3/check-otp satu percobaan salah -> Invalid OTP.
  2. (Screenshot 2) EKSPLOITASI: ulangi percobaan; pada percobaan ke-10 lockout memicu -> 503 "You've exceeded the number of attempts" (kontrol per-sesi berjalan).

Rekaman lengkap

LAB Semua target adalah sistem lab. Tidak ada satu pun yang merupakan pekerjaan klien. Bukti ditampilkan apa adanya; secret dihitamkan.

Normal: satu percobaan OTP

Alur normal: satu percobaan dengan OTP yang salah mendapat respons Invalid OTP.

HTTP request
POST /identity/api/auth/v3/check-otp HTTP/1.1
Host: 127.0.0.1:8888
Content-Type: application/json

{"email":"[REDACTED-EMAIL]","otp":"9001","password":"[REDACTED-LAB-VALUE]"}
HTTP response
HTTP/1.1 500
Server: openresty/1.27.1.2
Content-Type: application/json
Content-Length: 58

{
  "message": "Invalid OTP! Please try again..",
  "status": 500
}
Normal: satu percobaan OTP

Hasil: lockout setelah 9 percobaan OTP (PASS)

Hasil (PASS): brute-force OTP dalam satu sesi memicu lockout setelah 9 percobaan (503 exceeded attempts). Lockout berjalan pada pengujian ini, tetapi dapat dilewati melalui forget-password; lihat [FAIL].

HTTP request
POST /identity/api/auth/v3/check-otp HTTP/1.1
Host: 127.0.0.1:8888
Content-Type: application/json

{"email":"[REDACTED-EMAIL]","otp":"<diulang>","password":"[REDACTED-LAB-VALUE]"}
HTTP response
HTTP/1.1 503
Server: openresty/1.27.1.2
Content-Type: application/json
Content-Length: 66

{
  "message": "You've exceeded the number of attempts.",
  "status": 503
}
Hasil: lockout setelah 9 percobaan OTP (PASS)

← Kasus sebelumnya: NoSQL Injection - Community - Coupon Validation (Normal Input) Kasus berikutnya: OTP Bruteforce Protection Bypass - Authentication - Password Reset →