SEC-003 P0: Demo 帳密暴露於編譯時 + AUTO_DEMO_LOGIN 環境變數

Resolved 💬 2 comments Opened Mar 22, 2026 by stephen-taipei Closed Mar 25, 2026

問題描述

Demo 帳戶的電子郵件和密碼硬編碼在代碼中,並可透過環境變數 AUTO_DEMO_LOGIN 在執行時自動啟動。

檔案位置

  • ios-swift/Connectors/Managers/AuthManager.swift:166-180 (demoEmail/demoPassword)
  • ios-swift/Connectors/Managers/AuthManager.swift:829 (AUTO_DEMO_LOGIN)
  • ios-swift/Connectors-ipad/Managers/AuthManager.swift (重複)

詳細說明

硬編碼的 Demo 憑證預設值 (demo@ctrs.app / Demo123!) 可被逆向工程得知,AUTO_DEMO_LOGIN 環境變數任何執行環境都可設定。

風險評估

Demo 帳戶被濫用、測試數據污染、安全認證風險

解決方案

  1. 從代碼中完全移除 Demo 憑證預設值
  2. 移除 AUTO_DEMO_LOGIN 環境變數支援
  3. Demo Mode 僅在 DEBUG 編譯時生效
  4. Release build 中完全禁用 Demo Mode

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗