Skip to content

fix: update CORS whitelist to mimo.xiaomi.com (#139), strip stack traces from error responses (#154), redact MCP access tokens (#156)#798

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-cors-stacktrace-token
Open

fix: update CORS whitelist to mimo.xiaomi.com (#139), strip stack traces from error responses (#154), redact MCP access tokens (#156)#798
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-cors-stacktrace-token

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Three security/correctness fixes in 2 files:

Fix #139 — CORS whitelist still allows opencode.ai

The CORS origin regex in middleware.ts still whitelisted *.opencode.ai. After the rebrand to MiMo Code, the web UI and desktop app originate from mimo.xiaomi.com, so cross-origin requests were blocked.

Fix: Update regex from opencode.ai to mimo.xiaomi.com.

Fix #154 — Stack traces leaked in 500 error responses

The error handler sent err.stack (full stack trace with file paths, line numbers, dependency versions) to the client in JSON error responses.

Fix: Use err.message instead, which gives the error description without internal details.

Fix #156 — MCP access token partially visible in auth status

mcp auth status displayed the first 20 characters of the OAuth access token. This could be captured via screen recordings, terminal logs, or shoulder-surfing.

Fix: Replace with "present" / "missing" indicator.

… stack traces from error responses (XiaomiMiMo#154), redact MCP access tokens (XiaomiMiMo#156)

- CORS middleware: regex whitelist changed from opencode.ai to
  mimo.xiaomi.com so the web UI and desktop app can make
  cross-origin requests after the rebrand.

- Error handler: use err.message instead of err.stack in 500
  responses, preventing internal file paths, dependency versions,
  and code structure from leaking to clients.

- MCP auth status: replace partial access token display
  (first 20 chars) with 'present'/'missing' to prevent token
  leakage via screen recordings, terminal logs, or shoulder-surfing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant