Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#11,991 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, postgresql

Direzione di ricerca

Trova il percorso del log di raccolta PostgreSQL per il pool di agenti e confrontalo con il percorso di logging del database di autenticazione, che esegue già il redacting del proprio DSN. Riproduci il problema con un DSN di un pool di agenti PostgreSQL, applica l’approccio di redazione esistente al valore registrato e verifica che la password non compaia più nel log di raccolta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
49.2k
Fork
4.5k
Merge medio
1g 7h
PR unite (30g)
362

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mudler/LocalAI

Tutte le issue di mudler/LocalAI

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.