Skip to content

[Security][Privacy][Local Runtime] Bundled serverの一時APIキーをProcess argumentsへ渡しており、同一ユーザーのプロセスから取得可能 #500

Closed

Description

@shirokuma-xv

概要

ローカルBundled serverの認証用APIキーを生成していますが、server起動時に --api-key の引数として渡しています。

根拠

  • KizunaAI/AI/LocalAssistantRuntimeBridge.swift:1003-1023
  • serverは127.0.0.1 bindでも、他プロセスから接続できるためAPI keyを発行している設計です。

問題

API keyをargvへ渡すと、同一ユーザーの別プロセス、診断ツール、プロセス監視ログなどから取得される可能性があります。取得後はlocalhostの生成APIへ接続し、Kizunaのモデルへ任意リクエストを送れる可能性があります。

修正案

keyをargvではなくpipe/保護ファイル/標準入力経由でserverへ渡すか、ランダムなUnix domain socketを使う。起動中のProcess argumentsに認証情報を出さない。

テスト

server起動中のProcess argumentsにAPI keyが含まれないこと、keyなしの第三者接続が拒否されることを確認する。

Activity

  1. shirokuma-xv commented on Aug 21, 2026

    @shirokuma-xv
    ContributorAuthor

    Fixed in merged PR #475 (merge commit 8eb404c). Bundled server authentication is written to a temporary 0600 file and passed with --api-key-file; the secret is not included as a process argument and the file is removed on termination/failure. The original PR used a combined Fixes #499/#500 reference, so this issue was not auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions