Commit Graph

12 Commits

Author SHA1 Message Date
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
Marcello Fitton
4a4378ed99 chore: add ESLint to /server (#5126)
* add eslint config to server

* add break statements to switch case

* add support for browser globals and turn off empty catch blocks

* disable lines with useless try/catch wrappers

* format

* fix no-undef errors

* disbale lines violating no-unsafe-finally

* ignore syncStaticLists.mjs

* use proper null check for creatorId instead of unreachable nullish coalescing

* remove unneeded typescript eslint comment

* make no-unused-private-class-members a warning

* disable line for no-empty-objects

* add new lint script

* fix no-unused-vars violations

* make no-unsued-vars an error

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
2026-03-05 16:32:45 -08:00
Marcello Fitton
6855bbf695 Refactor Class Name Logging (#4426)
* Add className property to various LLM and embedder classes to fix logging bug after minification

* Fix bug with this.log method by applying the missing private field symbol
2025-09-25 15:34:19 -10:00
start-life
20468d7053 Update common.js Hebrew language update (#4241)
* Update common.js

Hebrew language update

* linting

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2025-08-05 09:55:08 -07:00
Roman Wu
78cbb06c57 Modify the PostgreSQL SQL connector to support querying tables from schemas other than the default public schema. (#4202)
* Add PostgreSQL schema support to SQL connector

- Add schema configuration option to PostgreSQL connector
- Update SQL queries to filter by specified schema
- Add schema input field to frontend connection modal (PostgreSQL only)
- Default to 'public' schema when no custom schema specified
- Add getQualifiedTableName() method for schema.table format

* Fix code formatting after linting

* Update Postgresql.js

* add back removal of ending curly brace

* Update Postgresql.js

* add back removal of ending curly brace (again?)

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2025-07-28 08:43:15 -07:00
Sean Hatfield
49ea545d7f SQL preflight connection validation (#4150)
* wip sql connection string validation

* handle failed sql connections in frontend

* sql preflight connection validation on modal save

* revert unneeded be/fe changes

* linting, form updates

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2025-07-16 09:02:39 -07:00
Sean Hatfield
fe1dfb1fde Add option to enable encryption on MSSQL Server db (#4134)
* add option to enable encryption on mssql server dbs

* add tests for ConnectionStringParser
2025-07-15 15:26:38 -07:00
timothycarambat
ae2fa8805c resolves #4040 2025-07-10 13:20:39 -07:00
Timothy Carambat
1c905b1105 Replace connectionString parser for sql-agent (#3560)
resolves #3551
2025-03-28 12:46:21 -07:00
Timothy Carambat
23de85a3bd Revert odbc support (#1936)
* Revert "Patch ODBC support from missing binary/headers for node-odbc"

This reverts commit 9de6b1cc26.

* Revert "OBDC Support (#1933)"

This reverts commit cd597a361e.
2024-07-23 17:27:39 -07:00
Timothy Carambat
cd597a361e OBDC Support (#1933)
* add possibility to connect to SQL Base by ODBC

---------

Co-authored-by: suchaudn <nicolas.suchaud@legrand.fr>
Co-authored-by: nicho2 <nicho2@laposte.net>
2024-07-23 12:42:53 -07:00
Timothy Carambat
15cf921616 Support SQL Agent skill (#1411)
* Support SQL Agent skill

* add MSSQL agent connector

* Add frontend to agent skills
remove FAKE_DB mock
reset skills to pickup child-skill dynamically

* add prompt examples for tools on untooled

* add better logging on SQL agents

* Wipe toolruns on each chat relay so tools can be used within the same session

* update comments
2024-05-16 10:38:21 -07:00