Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Agent pool Postgres DSN is logged in cleartext, including the password, while the auth DSN is redacted

オープン 初心者向け
#11,991 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, postgresql

調査の方向性

エージェントプールの PostgreSQL コレクションログのパスを見つけ、DSN をすでに redact している認証データベースのロギングパスと比較します。PostgreSQL エージェントプールの DSN で問題を再現し、既存の redact アプローチをログに記録された値に適用して、コレクションログにパスワードが表示されなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

説明

LocalAI version

v4.9.0 (localai/localai:latest-gpu-nvidia-cuda-12, revision f7ad3f70eb5d8a0ddf80e08557f0d7df28cf032e)

Describe the bug

When the agent pool uses the Postgres vector engine, LocalAI logs the full
LOCALAI_AGENT_POOL_DATABASE_URL at INFO level, including the database
password in cleartext, every time it opens a collection.

The auth database URL is redacted correctly in the same log stream, so the
redaction helper already exists. It just is not applied on this path.

Redacted (correct), from LOCALAI_AUTH_DATABASE_URL:

INFO Auth enabled database="postgresql://%2A%2A%2A:%2A%2A%2A@postgres:5432/localai_auth?sslmode=disable"

Not redacted, from LOCALAI_AGENT_POOL_DATABASE_URL (password replaced by hand
before pasting here):

INFO PostgreSQL collection collectionName="AML" databaseURL="postgresql://localai_user:REDACTED-PASSWORD@postgres:5432/localai?sslmode=disable"

One line is emitted per collection on every start, so the credential is
repeated and persists in whatever collects container logs. In a Docker
deployment these sit on disk under the json-file driver and are readable by
anyone who can read container logs, for example through a management UI,
without any access to the environment or the compose file.

To Reproduce
  1. Set LOCALAI_AGENT_POOL_VECTOR_ENGINE=postgres and
    LOCALAI_AGENT_POOL_DATABASE_URL=postgresql://user:password@host:5432/db?sslmode=disable
  2. Have at least one agent collection defined.
  3. Start LocalAI and read the log.

The PostgreSQL collection line contains the password verbatim.

Expected behavior

The agent pool DSN should be redacted in logs the same way the auth DSN
already is, or the log line should print only the host, port and database
name rather than the whole URL.

Additional context

Not configurable from the outside: the value has to be a DSN, so there is no
way for an operator to avoid this short of not using the Postgres vector
engine. Rotating the password does not help, because the new one is logged
too.

Suggested fix: apply the same redaction used for the auth DSN to the agent
pool DSN before logging.

主要言語
Go
スター
49.2k
フォーク
4.5k
平均マージ
19時間 42分
マージ済み PR(30日)
299

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mudler/LocalAI のほかの issue

mudler/LocalAI の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。