Repository navigation
Description
Original Linear description
Context
Surfaced by the reviewer-a open-source security review of ~/git-repos/inkie-pgr (2026-07-09). Full doc: ~/inkie-io/dev-notes/2026-07-09-pgr-opensource-security-review.md.
Finding
The README claims the pgr SQL guard is "bypass-proof". That is empirically false. Verified by running the guard:
- Write-CTEs pass:
WITH t AS (INSERT ... RETURNING ...) SELECT ... SELECT ... INTO newtablepasses.
Both statements write. They only actually mutate data when pgr runs under the legacy service-role fallback connection. Under the intended inkie_readonly_agent role (BYPASSRLS, REVOKE on auth/storage, SELECT allowlist, bounded statement_timeout) these writes are rejected by the role's own privileges, so today this is defence-in-depth, not a live hole. The readonly role is the true security boundary.
Scope
- Remove the legacy service-role fallback entirely, or flag-gate it off by default (opt-in env only, loud warning when active), so the write-CTE / SELECT-INTO path can never mutate data in normal operation.
- Soften the README: drop the absolute "bypass-proof" claim, document that the
inkie_readonly_agentrole is the real boundary and the string-level SQL guard is a secondary filter, not a guarantee. - Optional hardening: tighten the guard to reject data-modifying CTEs and
INTOtargets at the string level too, so guard and role agree.
Not in scope
No open-sourcing work here. This is the standalone hardening item; the open-source publish prep (squashed repo, LICENCE, README) is tracked separately.
Acceptance
- Service-role fallback removed or off-by-default with an explicit opt-in.
- Write-CTE and SELECT-INTO cannot mutate under the default pgr invocation.
- README no longer claims bypass-proof; documents the role as the boundary.
Origin
Migrated from Linear: INK-649. The original wording is retained except the disclosed privacy and rendering edits below.
Current scope and qualifications
The description above is the full original Linear account. Its historical verification and provider claims have not been independently revalidated by this transfer.
Current Linear state is Backlog. The historical report is retained; this transfer does not independently establish completion against the current public baseline.
Publication transfers the task; it does not authorise live recovery, deployment, spending or configuration changes.
Transfer edits
- Historical fleet identities are aliased; code identifiers and permitted source paths remain references.
- Additional transfer edits: replace local prepublication-process boilerplate with bounded qualification.
Activity