Khi user yêu cầu reset password và nhấn vào link được gửi đến email, application sẽ cung cấp một cookie với thời gian khá dài:

Nếu một người dùng nào đó khác dùng chung máy tính thì có thể truy cập vào trang forgot password (https://hosted.weblate.org/accounts/reset/) để thực hiện reset password.

Insufficient Session Expiration - Previously Issued Email Change Tokens Do not Expire upon Issuing a New Email Change Token broken-authentication

Khi thay đổi email thì ta sẽ nhận được token trong email. Tuy nhiên, server không expire token cũ nếu yêu cầu một token mới.

Đây chỉ là một bug liên quan đến best practices.

Bypass auth.email-domains broken-authentication

Email addresses được lưu trong database với kiểu là VARCHAR(64) và kích thước của nó chỉ được validate ở client-side. Tuy nhiên, attacker có thể đăng ký user với email có 128 ký tự với @allowed-domain.com (email domain được phép đăng ký) ở cuối. Sau khi bypass được việc kiểm tra xem email có thuộc allowed domains hay không, MySQL sẽ truncate phần @allowed-domain.com do nó không thể lưu email quá dài và sẽ gửi verification email đến email domain của attacker.

Ví dụ, email aaaaa...aaaaa@evil.com@company.com sẽ được truncated phần @company.com và verification email sẽ được gửi đến @evil.com.

Report này tương tự với report Phabricator | Report #2224 - Bypass auth.email-domains | HackerOne.

Seealso

SSO Bypass in Zendesk Using Trint Organization Able to Leak Internal Ticket Information broken-authentication

Attacker có thể đăng ký tài khoản với email *@trint.com (email domain thuộc về tổ chức của program) ở trên domain app.trint.com mà không cần xác thực email. Dẫn đến, attacker có thể claim email này và thực hiện đăng nhập vào Zendesk của program thông qua SSO login.

Cụ thể hơn, sau khi đăng ký tài khoản thì có một request gửi đến https://graphql2.trint.com/ để lấy token đăng nhập vào Zendesk:

POST / HTTP/1.1
Host: graphql2.trint.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://app.trint.com/
content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJodHRwczovL2FwcC50cmludC5jb20vdXNlcklkIjoiNWRjOTUwZWEzOGFhMjI3MmExNzAyMzFkIiwiaHR0cHM6Ly9hcHAudHJpbnQuY29tL2lzTmV3VXNlciI6dHJ1ZSwiaHR0cHM6Ly9zY2hlbWEudHJpbnQuY29tL2F1dGhqdGkiOiI0ZmMwMjUyZS03NTFiLTQwNjctOWU0MC00OGQ4MWMzMjRiMjIiLCJpc3MiOiJodHRwczovL3RyaW50LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw1ZGM5NTBlYTM4YWEyMjcyYTE3MDIzMWQiLCJhdWQiOiJ0cmludC1hcGlzIiwiaWF0IjoxNTczNDc0NTQyLCJleHAiOjE1NzYwNjY1NDIsImF6cCI6ImljaDRoeVZZUEtLZ2VFb1RoNmZXUFhjNmZydmVUY1RxIiwiZ3R5IjoicGFzc3dvcmQifQ.JyIc6PZyjidptrvaFT6MykOr0BopUi1F7fZWTvbeKeU
X-Trint-Request-Id: 4b2f23d5-98a3-4571-a9e1-4218cca76e1b
X-Trint-Super-Properties: {}
Origin: https://app.trint.com
Content-Length: 111
Connection: close
 
{"operationName":null,"variables":{"status":"PENDING"},"query":"query zendeskToken {\n    zendeskToken\n  }\n"}

Response:

HTTP/1.1 200 OK
Date: Mon, 11 Nov 2019 12:17:06 GMT
Content-Type: application/json
Content-Length: 272
Connection: close
X-Powered-By: Express
Access-Control-Allow-Origin: *
Vary: Accept-Encoding
 
{"data":{"zendeskToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NzM0NzQ2MjYsImp0aSI6IjcwOWM2Njg3LWI3OWUtNDI2ZC04MjJhLWVkYTUyYzM3ZDAyYyIsIm5hbWUiOiJzZGFkc2FzZGEgYXNkc2FkYXMiLCJlbWFpbCI6InN1cHBvcnQrMUB0cmludC5jb20ifQ.G8VnRzcF5vkDl4X36_-olJNjtdawMn5G0KaL0FHPdQM"}}

Attacker tạo ra URL sau để truy cập vào Zendesk instance của program:

https://trintsupport.zendesk.com/access/jwt?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NzM0NzQ2MjYsImp0aSI6IjcwOWM2Njg3LWI3OWUtNDI2ZC04MjJhLWVkYTUyYzM3ZDAyYyIsIm5hbWUiOiJzZGFkc2FzZGEgYXNkc2FkYXMiLCJlbWFpbCI6InN1cHBvcnQrMUB0cmludC5jb20ifQ.G8VnRzcF5vkDl4X36_-olJNjtdawMn5G0KaL0FHPdQM

Có thể thấy, param jwt có giá trị là zendeskToken nhận được.

Truy cập vào URL này và attacker có thể đăng nhập với email mà họ đã đăng ký (ví dụ support+1@trint.com). Impact là attacker có thể read được các ticket trong tổ chức của program.

Claiming the Listing of a Non-delivery Restaurant through OTP Manipulation 2fa-bypass

Tồn tại endpoint POST /restaurant-onboard-diy/v2/send-auto-claim-otp HTTP/2 dùng để gửi OTP đến số điện thoại của nhà hàng:

POST /restaurant-onboard-diy/v2/send-auto-claim-otp HTTP/2
Host: www.zomato.com
Cookie: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Length: 58
Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="90"
Accept: application/json, text/plain, */*
X-Zomato-Csrft: XXXXXXXXXXXXXXXXXXXXXXX
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Content-Type: application/json;charset=UTF-8
Origin: https://www.zomato.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.zomato.com/partner_with_us/ownership
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
 
{"number":"XXXXXXXXXX","isdCode":"+91","resId":"XXXXXXXXXX"}

Response:

{"status":"success","message":"OTP SENT","requestId":XXXXXXX,"code":2}

Attacker sẽ gửi request trên với numberresId là của hắn ta (attacker cần phải đăng ký một nhà hàng với số điện thoại của hắn) rồi lấy mã OTP. Sau đó, dùng request sau để claim nhà hàng bất kỳ:

POST /restaurant-onboard-diy/v2/verify-auto-claim-otp HTTP/2
Host: www.zomato.com
Cookie: XXXXXXXXXXXXXXXX
Content-Length: 68
Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="90"
Accept: application/json, text/plain, */*
X-Zomato-Csrft: XXXXXXXXXXXXXXXXXXXXX
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Content-Type: application/json;charset=UTF-8
Origin: https://www.zomato.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.zomato.com/partner_with_us/ownership
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
 
{"verificationCode":XXX,"requestId":"XXXXXXXX","resId":"XXXXXXXXX"}

Với verificationCode mà attacker đã nhận được và resId là ID của nhà hàng nạn nhân. Nếu nhà hàng nào không map owner/manager với nhà hàng thì attacker có thể claim nhà hàng đó.

Có thể thấy, việc dùng một OTP hợp lệ để attack tương tự với bug Bypass OTP Verification Code.

URL để reset mail có thể được dùng để thay đổi password nhiều lần. Thực hiện tấn công như sau:

  1. Gửi yêu cầu reset password
  2. Click vào reset link
  3. Nhập password mới và cập nhật password. Sau đó, application sẽ redirect về trang login.
  4. Nhấn gửi yêu cầu reset password lần nữa.
  5. Thay vì hiển thị thông báo yêu cầu user check mail thì nó lại hiển thị prompt yêu cầu nhập password mới.
  6. Nhập password mới và cập nhật thành công.

Kịch bản tấn công có thể là: attacker dụ nạn nhân thay đổi password một lần rồi thực hiện bước 4 đến bước 6 để thay đổi password của tài khoản nạn nhân mà không cần quyền truy cập vào email hay reset link.

Insecure Account Removal broken-authentication

Application cho phép tạo tài khoản nhưng không cần nhập password và việc xóa tài khoản cũng không yêu cầu đăng nhập lại (do không có password).

Session Misconfiguration on Change Password Feature at https://apps-staging.pingone.com/myaccount/?environmentId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx# broken-authentication misconfiguration

Đây là một lỗ hổng session misconfiguration ở chức năng thay đổi password ở https://apps-staging.pingone.com/:

  1. Truy cập vào https://apps-staging.pingone.com/myaccount/?environmentId=XXXXX và login bằng user A ở trình duyệt A.
  2. Truy cập https://apps-staging.pingone.com/myaccount/?environmentId=XXXXX#changePassword ở trình duyệt B và login với cùng tài khoản.
  3. Thay đổi password ở trình duyệt B.
  4. Session của trinh duyệt A vẫn còn dùng được, dẫn đến lỗ hổng session misconfiguration.

Email Verification Bypass by Bruteforcing when Setting up 2FA broken-authentication

Attacker có thể tạo tài khoản bằng email của nạn nhân rồi bypass quá trình xác thực email khi thiếp lập 2FA bằng cách thực hiện brute-force (tương tự với [[Port Swigger - Authentication#|## Brute-forcing 2FA Verification Codes]]). Victim khi đăng nhập bằng email của họ nhưng không thể do không có mã 2FA. Đây được gọi là pre account takeover.

Apache Airflow Fab Provider: Application Does not Invalidate Session after Password Change via Airflow CLI broken-authentication

Ứng dụng không terminate toàn bộ các active session khi user thực hiện reset password. Đây là một good practices để đảm bảo khi user bị hacked thì có thể loại bỏ quyền truy cập của hacker.

Tip

Dù chỉ là một issue về good practice nhưng program vẫn accept.

Account Takeover Vulnerability in Shopify Collabs Platform Due to Missing Email Verification broken-authentication business-logic-errors

Researcher tìm thấy cách để takeover account của content creator mà đăng ký làm đại sứ thương hiệu của brand nào đó thông qua email của victim. Root cause là do application không thực hiện verify email khi attacker đăng ký một Shopify ID mới sử dụng email của victim.

Ability to Add and Verify Uncontrolled Mobile Numbers Leading to Account Takeover (ATO) 2fa-bypass

Attacker có thể chỉnh sửa response của request xác thực số điện thoại từ:

{
  "status": 400,
  "message": "Invalid OTP",
  "msisdn": "█████████",
  "success": false
}

Thành

{
  "status": 200,
  "message": "success",
  "msisdn": "██████████",
  "success": true
}

Để bypass quá trình xác thực 2FA và khiến cho ứng dụng cấp full quyền ở trên số điện thoại của victim. Điều này khiến cho attacker có thể takeover account của user.

Admin Dashboard Access Leads to Updating Merchant Info broken-authentication

Admin dashboard chỉ dành cho admin và không có chức năng đăng ký. Tuy nhiên, researcher tìm ra endpoint cho phép đăng ký và truy cập được vào admin dashboard.

Account Takeover via Password Reset without User Interactions broken-authentication

Ở chức năng reset password, attacker chỉ cần thay "user[email]":"victim@gmail.com" thành:

 "user" {
     "email" [
              "victim@gmail.com",
              "attacker@gmail.com"
       ]
 },

Là có thể gửi cùng 1 reset token cho 2 email. Attacker có thể lợi dùng điều này để reset password của user.

Oh-Auth - Abusing OAuth to Take over Millions of Accounts

Traveling with OAuth - Account Takeover on Booking.com

Using Microsoft SSO to Achieve Full Account Takeover

Trivial Csharp Random Exploitation cryptography