AltimateAI / AltimateAI/altimate-code

data_diff: where_clause grammar validation

Abierto
#722 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
811
Forks
134
Merge medio
3 d 2 h
PR fusionados (30 d)
50

Descripción

Flagged during v0.5.22 release review (Security / Chaos Gremlin persona).

`where_clause` is passed verbatim into generated SQL at `native/connections/data-diff.ts:484` (`WHERE ${whereClause}`) and `:696` (`(${params.where_clause}) AND (${partWhere})`). It is LLM-supplied, gated by `sql_execute_read` permission, but not parsed.

Short-term mitigation shipped in 0.5.22:
- Permission prompt now surfaces the where_clause value (informed consent)
- Tool description explicitly warns it is interpolated verbatim and must not accept untrusted input

Proper fix (this issue):
- Parse the clause with a SQL parser (`sql-parser-cst` or similar) and reject DDL/multi-statement/UNION
- Or whitelist to a safe grammar (comparison ops on column names + literals)
- Keep verbatim mode available behind a config flag for power users

Deferred because: parser integration is meaningful design work; short-term mitigations hold the line.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.