Files
contracts/History/event-sourcing-security-fixes.md
T

33 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Исправление уязвимостей Event Sourcing — по шагам
**Дата:** 2026-06-22
**Источники:** Gemini Web + Sonnet анализ
## Выполненные шаги
| Шаг | Версия | Что | Файл |
|-----|--------|-----|------|
| 1 | v1.0.92 | SQL-инъекция — валидация UUID в _lucee_query | convert_server.py |
| 2 | v1.0.93 | Race condition MAX(seq) — добавлен FOR UPDATE | apply_events.cfm |
| fix | v1.0.100 | Убран FOR UPDATE (несовместим с aggregate в PG) | apply_events.cfm |
| 3 | v1.0.94 | full_replace guard — проверка что ops не пуст | apply_events.cfm |
| 4 | v1.0.95 | Идемпотентность — проверка supplement уже обработан | apply_events.cfm |
| 5 | v1.0.97 | LLM ключ из env (не hardcoded) | convert_server.py |
| 6 | v1.0.98 | elements_json double-decode — handle str/list/dict | convert_server.py |
| 7 | v1.0.99 | isNumeric валидация price/qty/sum (ADD + UPDATE) | apply_events.cfm |
| 8 | v1.0.101 | Batch SELECT для UPDATE — один запрос вместо N+1 | apply_events.cfm |
## Осталось
| Шаг | Что | Файл |
|-----|-----|------|
| 9 | name_hash fuzzy fallback при UPDATE target not found | apply_events.cfm |
| 10 | Массовый INSERT вместо построчного | apply_events.cfm |
| 11 | UUID тип для last_event_id | apply_events.cfm |
## Примечания
- Шаг 2 (FOR UPDATE) отменён — нужен правильный SEQUENCE вместо MAX+FOR UPDATE
- Все изменения в convert_server.py требуют деплоя на ВМ (scp + systemctl restart)
- Все изменения в apply_events.cfm и index.cfm — git push → Lucee managed service