Blind SSRF in ads.tiktok.com SSRF
Tồn tại lỗ hổng blind SSRF ở trong TikTok ads portal. Mặc dù lỗ hổng này không có impact gì to lớn nhưng TikTok vẫn accept nó và thậm chí còn cung cấp môi trường để test blind SSRF:
Cite
Please see below for the usage of SSRF Sheriff:
- Test SSRF only with the following payload
- Full-read SSRF (A Flag will be returned to you): https://ssrf-bait.byted.org/full-read-ssrf
- Blind SSRF (Provide your own Flag as payload): https://ssrf-bait.byted.org/blind-ssrf/YOUR_OWN_FLAG
- Check if your SSRF was successful with the SSRF Flag with the following URL
- https://sf-ssrf-sherif.byted.app/obj/ssrf-detector-us/YOUR_OWN_FLAG
- If the response shows “True”, the SSRF was successful
SSRF Chained to Hit Internal Host Leading to Another SSRF Which Allows to Read Internal Images SSRF
Tồn tại URL https://image.api.np.km.playstation.net/ với endpoint /images và /dis/images cho phép thực hiện SSRF sử dụng image parameter. Cụ thể hơn, 2 endpoint này cho phép ta truy xuất image thông qua HTTP và convert nó về format tùy ý sử dụng format parameter. Nó có thể dùng để request đến các internal hosts nhưng response cần phải là một image hợp lệ.
Ví dụ:
URL https://store.mgmt.playstation.com/ (mgmt có nghĩa rằng đây là một internal host của PlayStation) sẽ trả về 403 với endpoint dưới đây:
https://store.mgmt.playstation.com/store/api/chihiro/00_09_000/container/US/en/999/UP4134-CUSA00329_00-ONNTGAME00000001/1429722215000/image?_version=00_09_000&platform=chihiro&w=225&h=225&bg_color=000000&opacity=100Tuy nhiên, ta có thể truy xuất image này sử dụng SSRF:
https://image.api.np.km.playstation.net/images/?format=png&image=https%3a//store.mgmt.playstation.com/store/api/chihiro/00_09_000/container/US/en/999/UP4134-CUSA00329_00-ONNTGAME00000001/1429722215000/image%3f_version%3d00_09_000%26platform%3dchihiro%26w%3d225%26h%3d225%26bg_color%3d000000%26opacity%3d100Attacker còn tìm thấy một internal host cho phép thực hiện SSRF:
https://dis.api.np.playstation.net/dis/v1/banners?backplate=https://homer.dl.playstation.net/pr/bam-art/272/352/44592b67-85ac-41d6-b310-334363c5ea58.jpg&dimensions=790x250&price=$36.99&price_discount=$24.41&format[]=PS4&type=Full Game&locale=en_CA&cta=Download Now!&output=png&tpl=banner-web-store&store=game®ion=us&Việc truy cập trực tiếp URL trên sẽ gây ra timeout.
Tuy nhiên, khi sử dụng SSRF thì có thể truy xuất file thông qua file protocol:
https://image.api.np.km.playstation.net/dis/images/?format=png&image=https%3A%2F%2Fdis.api.np.playstation.net%2Fdis%2Fv1%2Fbanners%3Fbackplate%3Dfile:////usr/share/pixmaps/system-logo-white.png%26dimensions%3D790x250%26price%3D%2436.99%26price_discount%3D%2424.41%26format%5B%5D%3DPS4%26type%3DF%22%3e%3c%73%3eull+Game%26locale%3Den_CA%26cta%3DDownload+No%26output%3Dsvg%26tpl%3Dbanner-web-store%26store%3Dgame%26region%3Dus%26Decode:
https://image.api.np.km.playstation.net/dis/images/?format=png&image=https://dis.api.np.playstation.net/dis/v1/banners?backplate=file:////usr/share/pixmaps/system-logo-white.png&dimensions=790x250&price=$36.99&price_discount=$24.41&format[]=PS4&type=F"><s>ull+Game&locale=en_CA&cta=Download+No&output=svg&tpl=banner-web-store&store=game®ion=us&Cụ thể hơn, URL trên sẽ mở file:////usr/share/pixmaps/system-logo-white.png ở trên server của dis.api.np.playstation.net thông qua image.api.np.km.playstation.net.
Flow:
Info
image.api.np.km.playstation.net→dis.api.np.playstation.net→ fetches the local image usingfile://→ adds given data on image → image served on (dis.api.np.playstation.net) → images served to us (usingimage.api.np.km.playstation.net)
SSRF - pivoting in the private LAN SSRF
Tồn tại lỗ hổng SSRF ở tính năng upload từ remote server của Concrete CMS. Mặc dù có check nhưng attacker có thể bypass các check đó như sau:
- Response code phải là 200 - không khó để bypass.
- File extension: có thể bypass bằng cách sử dụng http://192.168.1.148/index.php/test.png do mọi thứ phía sau
index.phpđều bị ignored và attacker có thể kiểm soát file extension. - Một vài check được thực hiện trên IP nhưng toàn bộ public IP và private IP đều được phép.
Nội dung trả về của SSRF sẽ được tải về thông qua một endpoint khác.
SSRF in hatchful.shopify.com SSRF
Attacker phát hiện ra ở chức năng tạo logo của Shopify cho phép chọn logo trong wysiwyg editor và nhập email rồi đợi. Trong quá trình này, application gửi đến browser hàng loạt gói tin web socket bao gồm một số file SVG mà đã bị escape dấu ". Sau đó, các file SVG này được browser gửi đến server để server chuyển thành file PNG và gửi qua email cho user.
Attacker có thể thay đổi file SVG gửi đến server và thêm vào xlink:href object nhằm:
- Liên kết đến các local image file của server.
- Tấn công DoS converter server.
- Chuyển protocol thành FTP để kết nối đến các FTP servers.
- Thử exploit các lỗ hổng chẳng hạn như Imagetragic hoặc XXE.
SVG Parser Loads External Resources on Image Upload SSRF
Attacker có thể upload file SVG mà có chứa attribute xlink:href trong thẻ image mà làm cho server gửi request đến URL được specify trong attribute đó. Đây là một dạng của SSRF tương tự như [[#[SSRF in hatchful.shopify.com](https //hackerone.com/reports/409701) SSRF SVG]].
Exposed Proxy Allows to Access Internal Reddit Domains SSRF broken-access-control
Attacker tìm được proxy ở https://52.90.28.77:30920/ cho phép truy cập vào các internal endpoints trong infrastructure của Reddit:
Attacker demo bằng cách dùng nó để truy cập vào host snoo.dev:
curl --insecure https://52.90.28.77:30920/reddit --header "Host: █████████"Biết được rằng nó là internal host được sử dụng bởi các nhân viên thông qua Censys: https://search.censys.io/search?resource=certificates&q=snoo.dev và đôi khi nó được nhắc đến ở trên GitHub: https://github.com/search?q=org%3Areddit%20snoo.dev&type=code.
Đây là một dạng SSRF.
Tip
Bằng cách tận dụng OSINT, attacker có thể tìm ra internal host để có thể tấn công.