Agent pool Postgres DSN is logged in cleartext, including the password, while the auth DSN is redacted
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 75/100
Línea de trabajo
Encuentra la ruta del log de colección de PostgreSQL para el grupo de agentes y compárala con la ruta de logging de la base de datos de autenticación, que ya redacta su DSN. Reproduce el problema con una DSN de un grupo de agentes de PostgreSQL, aplica el enfoque de redacción existente al valor registrado y verifica que la contraseña ya no aparezca en el log de colección.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Set
LOCALAI_AGENT_POOL_VECTOR_ENGINE=postgresand
LOCALAI_AGENT_POOL_DATABASE_URL=postgresql://user:password@host:5432/db?sslmode=disable - Have at least one agent collection defined.
- 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.
- Lenguaje dominante
- Go
- Estrellas
- 49.2k
- Forks
- 4.5k
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 357
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mudler/LocalAI
-
bug unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mudler/LocalAI#12337 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
mudler/LocalAI#11995 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
fish-speech: make compile:true usable on Blackwell sm_121 by honouring the CUDA toolkit's ptxasAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
mudler/LocalAI#11348 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug unconfirmed
Dificultad 4/5 3-5 días Aptitud para principiantes 70/100
mudler/LocalAI#12331 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
feat: add automatic MCP transport selection for 2024-11-05 / 2025-03-26 / 2025-06-18 vs 2025-11-25Abiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
mudler/LocalAI#12262 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de mudler/LocalAI
Issues similares
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
DataDog/dd-trace-go#5469 ·
Los mantenedores suelen responder en 1 día
-
bug tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
l3montree-dev/devguard#3101 ·
Los mantenedores suelen responder en 1 día
-
area:*of bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
oapi-codegen/oapi-codegen#2593 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
DaoCloud/DaoCloud-docs#7432 ·
Los mantenedores suelen responder en 1 día