Non-secure Requests Are not Automatically Upgraded to HTTPS
Các HTTP request gửi đến hackerone.com
không được tự động upgrade lên HTTPS. Do hackerone.com
sử dụng HSTS preload. Tại thời điểm report được submit, một số browser chưa implement tính năng HSTS nên có thể connection sẽ không thông qua HSTS.
Cụ thể, khi gửi HEAD request đến http://hackerone.com, server không instruct browser để upgrade connection lên HTTPS và trả về response có status code 200 thay vì 301 với Location
là https://hackerone.com
.
Để exploit, attacker cần:
- Ở trong cùng network với victim để có thể sniffing.
- Trick victim mở http://hackerone.com trong trình duyệt mà không có
hackerone.com
ở trong preload list.
Missing Robots Exclusion Header for User Uploads
Khi user upload text file lên platform thì nó có thể được linked bởi các external website và dẫn đến là xuất hiện trong các search engine thông qua dorking chẳng hạn như site:*.irccloud-cdn.com ext:txt
.
Application không hoàn toàn có thể ngăn chặn điều này nhưng có thể sử dụng header X-Robots-Tag
để chặn các crawlers.
Application DOS via Specially Crafted Payload on 3d.cs.money
Attacker có thể DoS application chỉ thông qua 1 request duy nhất ở endpoint https://3d.cs.money/item/default và downtime phụ thuộc vào payload sử dụng.
Request:
POST /api/skin/search HTTP/1.1
Host: 3d.cs.money
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json;charset=utf-8
Content-Length: 32
Origin: https://3d.cs.money
Connection: close
Referer: https://3d.cs.money/item/default
Cookie: __cfduid=d38bfad20d6ec52ba0a6af9014d27a2e81601313370; TEST_GROUP=2; UUID3D=to4nZuWnRSS4A7G; _ga=GA1.1.214308118.1601313374; _ga_HY7CCPCD7H=GS1.1.1601313373.1.1.1601316641.57; _gid=GA1.2.24460124.1601313377
{"name":"[Payload here]","item_name":"AK-47"}
Payload sử dụng là (((((()0)))))
. Nếu sử dụng nhiều cặp ngoặc tròn hơn chẳng hạn như ((((((()0))))))
thì downtime sẽ lâu hơn.
Report này đáng lẽ không được chấp nhận do nó là DoS nhưng do chỉ dùng một request và downtime phụ thuộc vào payload nên nó được chấp nhận.
Open Redirect in eb9f.pivcac.prod.login.gov
Tồn tại “lỗ hổng” open redirect ở URL sau:
https://eb9f.pivcac.prod.login.gov/?nonce=wI0UglN84A06Q4z4JnkZVc3i1V8%3D&redirect_uri=https%3A%2F%2Fgoogle.com%23%40secure.login.gov%2Flogin%2Fpiv_cac
Decode:
https://eb9f.pivcac.prod.login.gov/?nonce=wI0UglN84A06Q4z4JnkZVc3i1V8=&redirect_uri=https://google.com#@secure.login.gov/login/piv_cac
Có thể thấy, payload sử dụng `#` để ignore white-listed domain ở phía sau mặc dù vẫn dùng dấu `@` (có thể là để bypass một trong số những URL parsers).
Mặc dù là open redirect nhưng program vẫn chấp nhận.
Bypass auth.email-domains
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.
[⚙ D8308 Disallow email addresses which will overflow MySQL storage](https://secure.phabricator.com/D8308)
Api Data Leak
Attacker tìm thấy một vài URL ở trên https://web.archive.org/web/*/https://api.planet.com/ để lộ API key trong query param mà có thể sử dụng được:
- https://api.planet.com/basemaps/v1/mosaics?api_key=afdb1e8a9c8142739553e3942283d6c8&_page_size=1000
- https://api.planet.com/basemaps/v1/mosaics/wmts?service=wmts&request=GetCapabilities&format=text%2Fxml&api_key=8fe044edc78c46ba904bb62e550493a3
Có thể thấy, ta nên tận dụng Wayback Machine bằng cách tìm tất cả các URLs liên quan đến một host/domain/wildcard nào đó.
Github Token Leaked Publicly for https://github.sc-corp.net
Attacker tìm thấy một file ở trên GitHub thuộc về một Software Engineer của Snap Chat (Snap Inc) có chứa GitHub Token:
import os
import requests
import sys
pull_number = 76793
pull_url = "https://github.sc-corp.net/api/v3/repos/Snapchat/android/pulls/" + str(pull_number)
payload = {}
payload["Authorization"] = "token " + "9db9ca3440e535d90408a32a9c03d415979da910"
print payload
r = requests.get(pull_url,
Mặc dù attacker không verify token và https://github.sc-corp.net chỉ cho phép đăng nhập với email có `@snap` domain nhưng program vẫn accept nó.
Hacker Email Disclosed on Submission at Hackerone Hactivity
Attacker tìm thấy một report được disclosed thông qua Hacktivity mà trong PoC video có chứa email của hacker. Khi attacker tạo email với email được disclosed thì nhận được thông báo rằng email đã được sử dụng.
Finding này tương tự với report HackerOne | Report #2134874 - Hackers two email disclosed on submission at hackerone hactivity | HackerOne: email của hacker bị disclosed trong PoC video mà không có biện pháp nào để che nó đi.
Việc để lộ email address vẫn là một cái gì đó có thể report được tùy ngữ cảnh.
Cleartext Password Returned in JSON Response
Attacker phát hiện rằng plaintext password được trả về trong JSON response khi thực hiện thay đổi password. Password này có thể được trích xuất thông qua memory dump của tiến trình firefox.exed
. Thậm chí là password này vẫn còn trong RAM kể cả khi restart Firefox.
Việc trả về plaintext password trong response có thể xem như là một bad practices nhưng thật sự thì nó không có impact gì cả. Tuy nhiên, attacker lại nghĩ đến cách mà có thể extract password thông qua RAM làm nó có thể được xem như là một finding.
ci.nextcloud.com
: CVE-2015-5477 BIND9 TKEY Vulnerability + Exploit (Denial of Service)
Attacker sử dụng nmap
ở domain ci.nextcloud.com
:
Starting Nmap 7.40 ( https://nmap.org ) at 2017-06-08 04:12 PKT
Nmap scan report for ci.nextcloud.com (█████)
Host is up (0.077s latency).
rDNS record for █████████: ███████
Not shown: 96 filtered ports
PORT STATE SERVICE VERSION
22/tcp open tcpwrapped
53/tcp open tcpwrapped
80/tcp open tcpwrapped
443/tcp open tcpwrapped
Và tìm thấy port 53 đang mở và chấp nhận kết nối:
──╼ $telnet
telnet> open
(to) ci.nextcloud.com 53
Trying ███...
Connected to ci.nextcloud.com.
Escape character is '^]'.
Attacker có thể khai thác CVE-2015-5477 để DoS server với PoC ở https://github.com/elceef/tkeypoc/.
Việc sử dụng `nmap` cho một domain nào đó nhằm tìm kiếm thêm các attack surfaces khác ngoài web attacks cũng là một cách hay.