Files
anything-llm/server/utils
Timothy Carambat 334ce052f0 Fix SQL injection in SQL Agent plugin via parameterized queries
Replace string concatenation with parameterized queries in all database
connectors to prevent SQL injection through LLM-generated table names.

Changes:
- PostgreSQL: Use $1, $2 placeholders with pg client parameterization
- MySQL: Use ? placeholders with mysql2 execute() prepared statements
- MSSQL: Use @p0 placeholders with request.input() parameterization
- Update handlers to support parameterized query objects
- Add formatQueryForDisplay() for logging parameterized queries

Security: Mitigates potential SQL injection when LLM passes unsanitized
user input as table_name parameter to getTableSchemaSql/getTablesSql.
GHSA-jwjx-mw2p-5wc7
2026-03-12 21:56:57 -07:00
..
2026-02-26 13:37:56 -08:00
2026-02-02 10:56:58 -08:00
2024-06-21 13:38:50 -07:00
2025-04-29 13:54:00 -07:00
2026-03-05 16:32:45 -08:00
2024-07-19 18:35:41 -07:00
2026-03-05 16:32:45 -08:00
2026-01-02 15:50:50 -08:00
2025-04-29 13:54:00 -07:00