@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / e27ca00
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 06:45 UTC

docs(finora): record default-public-execute tripwire gap and scoped QA repair

davoodmehraban89 committed Nov 22, 2026 at 21:27 UTC e27ca00e4a62043fae71027d43b1294f281f02a8
1 file changed +6
PROJECT_STATE.md
+6
@@ -707,3 +707,9 @@ Next action: run and inspect Quality on the latest PR212 head. If any browser te
707 - Reused the pre-existing `scripts/accounting-history-migration-guard.mjs` and `scripts/accounting-history-migration-guard.test.mjs`, without changing the workflow or a migration. Added `findUnsafePublicJournalIdentityRpcs` for **newly added/modified** public SECURITY DEFINER journal identity functions *granted to authenticated*: caller-controlled audit actor; direct registry-only post state; and identity allocation missing a direct persisted voucher lookup. The guard strips SQL comments, provides filename/line plus specific `FINORA_IDENTITY_RPC_MIGRATION_BLOCKED` CLI marker, and leaves existing posted→draft historical safeguard intact.
708 - Reproduced source shape against actual [PR219 SHA `ab14e46...`](https://github.com/davoodmehraban89/Factor-easy/pull/219): five static warnings at definition lines **53 (two), 106 (two), 133 (one)**. Added unit fixtures reflecting the source shape, safe private/canonical wrapper, comments and disposable temporary-Git base-to-head diff with fail/allow CLI cases. This is conservative **review tripwire** only: SQL parser completeness, actual Auth JWT and atomicity must still be independently verified by Codex-main.
709 - **Post-implementation verification pending until exact commit SHA Quality/WP1/WP2/Security run.** No server runtime, SQL migration, Auth/RLS/grants, main, merge, deployment or hosted database used. Issue216/229 remain product P0 OPEN; phase estimates unchanged.
710 +
711 +
712 +### 2026-11-22 — FIN-QA-ID-RPC-DEFAULT-EXECUTE / pre-code decision
713 +- Owner asked to continue. Existing [Draft PR237](https://github.com/davoodmehraban89/Factor-easy/pull/237) exact head `4c661721c911ac2c481657e6d4acb2b1ff06ac7c` has 3/3 triggered Quality/WP1/Security PASS, WP2 path-filtered. Instead of a new PR or financial implementation, inspect this specific QA guard for a security false-negative.
714 +- **Confirmed against PostgreSQL CREATE FUNCTION documentation**: function EXECUTE is granted to `PUBLIC` by default, absent an effective REVOKE or configured alternate default privileges. Existing `findUnsafePublicJournalIdentityRpcs` only checks `GRANT EXECUTE` found in the same newly changed SQL migration file, so a dangerous public SECURITY DEFINER identity function *without explicit GRANT* can evade review. Separate later migration containing only GRANT can also evade the same-file matcher. This is a **QA tripwire deficiency**, not a runtime exploit demonstration.
715 +- **Scoped change in existing PR237:** conservatively review dangerous newly created/changed public SECURITY DEFINER identity RPCs even without GRANT unless explicit effective PUBLIC REVOKE exists in the same SQL file, and review standalone public journal-identity GRANT statements in changed SQL migrations. Do not block ordinary safe private/canonical journal wrappers; add positive/negative Node fixtures and temporary-Git diff CLI tests. Maintain exact existing posted-history guard and use existing Quality/Security workflows, document regex limitations including ALTER DEFAULT PRIVILEGES, grants across roles or dynamic SQL. No SQL/migrations/Auth/grants/financial app code/schema/production/main/merge. Keep Issue216/229 OPEN and phases unchanged.