food-market/docs/sprint23-progress.md
nns 284ad095c1
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
Docker API / Build + push API (push) Waiting to run
Docker API / Deploy API on stage (push) Blocked by required conditions
fix(s23): adversarial bug-hunt — 4 bugs found, all fixed
Sprint 23 (adversarial): атаковали систему как недоброжелатель.
Найдено 4 бага, все починены.

Bug #001 (Medium): NULL-byte в Product.Name вызывал 500 без тела.
  Postgres TEXT не принимает \x00. Добавил NoControlChars() в
  ProductInputValidator + CounterpartyInputValidator.

Bug #002 (Low): ProductInputValidator MaximumLength(200) конфликтовал
  со StringLength(500) в DTO и schema HasMaxLength(500). Сделал 500
  везде. Counterparty: 200 → 255 (matches HasMaxLength).

Bug #003 (CRITICAL): параллельные posting'и под Serializable выбрасывали
  PostgresException 40001 → middleware → 500 empty body. Добавил
  SerializationConflictMiddleware который мапит 40001 → 409 Conflict
  с {error, retryable: true}. Также SerializableRetry helper для
  явного retry внутри endpoint'ов с exp backoff. Применил retry-wrap
  к RetailSalesController.Post (PostCoreAsync extracted).

Bug #004 (Low): цена 0.0000001 округлялась до 0 уже после прохождения
  required-price check (check был ДО RoundIfNeeded). FindMissing-
  RequiredPriceAsync теперь округляет перед сравнением — required
  цена реально > 0 после rounding.

Bug reports: tests/e2e/reports/bugs/bug-00[1-4]-*.md (github-issue format).

Multi-tenant attacks (cat 3): clean — все cross-org GET/PUT/DELETE
дают 404, bulk-update affected=0, lists не утекают.
Auth-edge (cat 2): clean — JWT tampering 401, garbage 401, CORS evil.com
не получает allow-origin, fake refresh 400 invalid_grant.
DOS (cat 7): clean — 50MB body 413, 200 headers 431, long URL 200.
Hangfire safety (cat 8): clean — regular Admin → /hangfire 403,
  seed-demo использует tenant context, body org-id игнорируется.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-08 01:35:50 +05:00

27 lines
1.3 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.

# Sprint 23 — adversarial bug-hunt
Цель: атаковать систему как злонамеренный пользователь. После 22 спринтов
система зрелая, но скрытые баги ТОЧНО есть. Найти как можно больше,
сразу починить.
Старт: 2026-06-08. Исполнитель: Claude Opus 4.7.
## Категории атак
- [ ] **1. Race conditions** — параллельные POST на posting-endpoints
- [ ] **2. Auth edge** — JWT tampering / replay / SuperAdmin override
- [ ] **3. Multi-tenant via URL** — cross-org доступ через прямой ID
- [ ] **4. Validation bypass** — SQL/XSS/path-traversal/unicode
- [ ] **5. Numeric/decimal edge** — отрицательные, overflow, precision
- [ ] **6. Stock invariant** — 100 параллельных продаж
- [ ] **7. DOS protection** — SignalR flood, large bodies, slowloris
- [ ] **8. Hangfire-jobs safety** — admin-vs-superadmin, cross-tenant
Каждый найденный баг`reports/bugs-found-{n}.md` (github-style issue),
потом fix, потом retest.
## Журнал
### 2026-06-08 старт
Sprint 22 закрыт (7/7 ✓). Поехали по adversarial-attacks.