Commit Graph
14 Commits
Author SHA1 Message Date
Hamza-Ayed 67465df000 Update: 2026-08-07 05:56:50 2026-08-07 05:56:50 +03:00
Hamza-Ayed b938e287c6 Update: 2026-08-07 05:05:45 2026-08-07 05:05:46 +03:00
Hamza-Ayed 8e7c4a7104 Update: 2026-08-07 04:35:28 2026-08-07 04:35:28 +03:00
Hamza-Ayed f0ea698ab2 Update: 2026-08-07 02:58:47 2026-08-07 02:58:47 +03:00
Hamza-Ayed 3081aea802 Update: 2026-08-07 02:19:07 2026-08-07 02:19:07 +03:00
Hamza-Ayed b492034bad Update: 2026-08-07 02:10:33 2026-08-07 02:10:33 +03:00
Hamza-Ayed 0cb1ab0ea3 Update: 2026-08-07 01:06:09 2026-08-07 01:06:09 +03:00
Hamza-Ayed a1104a4695 Update: 2026-08-07 00:57:03 2026-08-07 00:57:03 +03:00
Hamza-Ayed 6e451e8b71 Update: 2026-08-07 00:36:27 2026-08-07 00:36:27 +03:00
Hamza-Ayed 79333a4bee Update: 2026-08-03 13:22:27 2026-08-03 13:22:27 +03:00
Hamza-Ayed 2b9f696372 Update: 2026-08-03 00:20:40 2026-08-03 00:20:40 +03:00
Hamza-Ayed 2c962bf80a Update: 2026-08-02 22:51:18 2026-08-02 22:51:18 +03:00
Hamza-AyedandClaude Opus 5 6802026dbd Add blind-index search layer; fix captain detail 200-with-empty-body
Searching encrypted columns currently works only because encryptData() is
AES-CBC with a fixed IV, i.e. deterministic. That determinism is what leaks
equality and shared prefixes, and it is why moving storage to AES-GCM would
break every lookup. This separates the two concerns.

- core/Security/BlindIndex.php: HMAC-SHA256 over a normalised value, keyed by
  a secret pepper. Phone numbers have a small keyspace, so a bare SHA-256
  would be reversible by enumeration; the pepper lives in the environment, not
  the database. The scope string includes table and field so the same number
  does not produce a matching index across tables.
  Normalisation unifies local/international phone forms, lowercases emails and
  folds Arabic alef/ya/ta-marbuta and diacritics for names.
- migrations/: nullable *_bidx columns plus indexes, and the missing
  adminUser.status/approved_by/approved_at columns that admin approvals need.
- scripts/backfill_blind_index.php: restartable, batched, --dry-run capable,
  touches only index columns.
- Admin lookups by phone/email now match the index, keeping the old ciphertext
  comparison in the same query so search keeps working until the backfill runs.
  bootstrap exposes $blindIndex as null when no pepper is configured.

Also: AdminCaptain/getCaptainDetailsById.php selected driver.education, a
column absent from this schema. The PDOException was uncaught, so the client
received an empty body with HTTP 200 — the "non-JSON response" seen when
opening a captain. It now omits the column, catches the error, reports it as
JSON, and requires an admin role.

Console: opening any sidebar section refetches its data instead of showing
what was loaded when the console started.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 15:16:09 +03:00
Hamza-Ayed 474c212bcb refactor: migrate amount fields to decimal and implement location service restriction for unsupported regions 2026-07-24 15:08:37 +03:00