Cashback Eligibility Table Authorization Automation: Nothing Wrote Here, and Everyone Could

A gap in code nobody wrote is invisible to any review of the code
Reviewing an application's own source code for a security gap works by construction only for gaps that the code itself actually exercises — a code review can catch a function that writes to the wrong place, or checks the wrong permission, because there is a specific line of code to examine. A table that legitimately has NO application code writing to it at all sits entirely outside that method: there is no function, no call site, no code path for a review to inspect, because none exists. The only way to find a live, exploitable gap in a table like that is to ask the actual, current database directly what it currently permits — not to read the application's own source and reason about what it does.
How the underlying problem shows up before you fix it
A table's own write access was never individually, deliberately reviewed or narrowed — it still carries the same broad default privileges every newly-created database table receives automatically, simply because nobody has yet gone back to look at that specific table.
A systematic, direct search of the entire application codebase confirms zero code paths — no interface, no backend function, no database trigger — ever writes to a specific table, while a role the application's own permission model explicitly declares has no write access at all is still able to write to it directly at the database layer.
A field that looks, on the surface, like a minor or low-stakes flag (here, a single boolean controlling cashback eligibility) is, in its actual effect, a genuine financial control — a single incorrect value can silently exclude a real customer from using money they genuinely hold.
A security review scoped only to a cross-tenant test (does a member of a DIFFERENT organization get refused) reports a table as fully secure, while a same-organization, wrong-role test — checked systematically across every role the system recognizes, not assumed safe by default — reveals the actual gap.
A previous, same-week hardening pass deliberately EXCLUDED this specific table from its own scope, based on a judgment at the time that it was low-priority — a decision explicitly revisited and reversed once the table's real effect was measured directly.
Why a table nobody's code touches can still carry a live, exploitable gap
A database platform's own automatic default privileges are granted the moment a table is CREATED, entirely independent of whether any application code ever goes on to actually use that table for writing. A team's own attention, quite reasonably, tends to follow where the code actually exercises a path — a table with an active write function attached to it gets scrutinized because something is clearly happening there; a table nothing writes to yet can easily be assumed harmless specifically BECAUSE nothing appears to be happening, when in fact the database's own default access has been sitting open the entire time, waiting for anyone who reaches it directly rather than through the application's own interface.
How Centriu Loop closed a gap its own code never used, and could never have shown
A small Centriu Loop table holds a single meaningful field per customer: whether that customer is currently eligible to use their own cashback balance. An earlier, same-week authorization pass had deliberately left this specific table out of scope, judging it at the time to be a minor opt-out flag rather than a genuine financial control — a call the fix's own account is explicit was a mistake, because the redemption flow silently excludes any customer marked ineligible here from the eligible-customer list it checks, meaning one wrong row directly blocks a real customer from using cashback they genuinely hold.
Before closing the gap, a full, systematic review confirmed something specific and unusual about this exact table: literally zero lines of code anywhere in the application — no interface, no backend function, no database trigger — ever write to it. The only legitimate interaction with the table at all is a separate, trusted internal process reading from it, through its own privileged connection, specifically to decide which customers to include when counting active cashback participation.
Measured directly against a real database using the live production schema, testing systematically across every role the system recognizes rather than assuming any role beyond the obvious cross-tenant case was safe: an authenticated member of the correct organization, holding a role the application's own permission model explicitly marks as having NO write access anywhere in Loop, could still insert a new row and update an existing one in this table directly — because the table had simply never been individually reviewed, and still carried the same broad default insert-and-update privileges every new table receives automatically.
The fix revokes insert, update, and delete privileges from every role that should never have held them, and removes the two database policies — one for insert, one for update — that had granted write access to any ACTIVE member of the correct organization, with no further role distinction. Read access is left fully in place, since the trusted internal counting process, and any legitimate future feature that might read this same value, still need it. A companion mutation-tested check now specifically verifies BOTH that the migration's own safety guard correctly refuses to apply twice, AND that removing that same guard causes the underlying database privilege check itself to fail — confirming the protection comes from the actual database state, not merely from the migration script's own internal bookkeeping.
One genuinely useful negative result came out of the same investigation: a test that specifically omitted revoking DELETE privilege (checking whether that omission would be silently missed) produced NO behavior change at all, because no DELETE policy had ever existed on this table in the first place — row-level security was already correctly blocking deletion before this fix touched anything. The fix's own account draws out the general lesson directly: measuring observed BEHAVIOR is not a substitute for measuring the underlying PRIVILEGE directly, since a privilege that happens to have no matching policy will look identical, from a behavioral test alone, to a privilege that was genuinely revoked.
What is actually built today
A role the application's own permission model declares has no write access anywhere in Centriu Loop can no longer insert or update a row in this specific eligibility table — the database itself now enforces the identical rule the application already declared.
Insert, update, and delete privileges have been revoked from every role that should never have held them, and the two write-permitting database policies have been removed entirely.
Read access to this table remains fully intact, since a trusted internal process still needs it to correctly decide which customers to count for active cashback participation.
A single incorrect eligibility value can no longer be silently written by an unauthorized role — a real safeguard for the redemption flow, which checks exactly this field before allowing a customer to use their own balance.
A dedicated mutation-tested check verifies the fix by confirming the underlying database PRIVILEGE itself is what blocks the write, not merely the absence of a currently-observed code path that happens to exercise it.
A door with no doorway leading to it, left unlocked anyway (illustrative framing of the actual measured finding)
Before the fix, no legitimate path in the entire application ever led to writing this specific table — the door had no doorway built to it at all. But the door itself, reached directly rather than through any interface, was still unlocked: a role with no declared write access anywhere in Loop could open it and change what was inside. After the fix, the door is locked for that role regardless of whether any doorway to it exists — closing the gap even though nothing in the application's own code ever walks through it.
What changes operationally
A role Centriu Loop's own permission model explicitly declares has no write access anywhere in the product can no longer write to a specific table controlling cashback eligibility, closing a gap that existed purely at the database's own default-privilege layer — a gap invisible to any review of application code, since zero lines of code anywhere ever wrote to this table in the first place.
When this is not the right fit
This automation covers specifically the write-authorization of one small Centriu Loop table controlling cashback eligibility. It is a distinct mechanism from this pillar's separate pages on Loop's cashback ledger and campaign-configuration authorization — related in theme (a database-level access gap underneath an application-level rule) but each addressing a genuinely different, specific table.
Reviewing application code vs. querying the database's own actual permissions
Reviewing an application's own source code for authorization gaps is efficient and catches a great deal — for exactly the tables and functions the code actually touches. It structurally cannot catch a gap in a table nothing in the codebase writes to at all, because there is no code path for a review to examine. Directly querying the database's own current privileges and policies, table by table, independent of whether any application code currently exercises them, is the only version of the two that can find this specific, otherwise invisible class of gap.
Related systems
Main system: Centriu Loop.
What it does NOT do
- Does not affect legitimate read access to this table — the trusted internal process that counts active cashback participation, and any future legitimate feature needing this value, retain read access fully.
- Does not choose which specific access-control mechanism a future opt-out feature for this table should use — that remains an explicit, documented open product decision, not something this fix presumes to answer.
- Does not add any trigger, audit trail, or approval flow to this table — the fix specifically closes an unauthorized WRITE path; it does not change the table's own design or add new tracking beyond what already existed.
- Does not overlap with this pillar's separate pages on Loop's cashback ledger or campaign-configuration authorization — each covers a different, specific table with its own distinct gap and fix.
- Does not extend to any other unused table in Centriu's other systems automatically — this fix is specific to this one table, confirmed through a direct, systematic review to have carried this exact gap.
Security and governance
A role Centriu Loop's own permission model explicitly declares has no write access anywhere in the product can no longer write to a specific table controlling cashback eligibility — closed by revoking the underlying database privilege and removing the two policies that had granted it, confirmed with a mutation-tested check verifying the protection comes from the actual database state. Any personal or financial data referenced in eligibility records remains subject to Brazil's LGPD (Law No. 13,709/2018). Full detail on access control lives at /governanca and /iso.
Pricing and contracting
Available by monthly subscription, with tiered plans. Values and terms come from the official pricing table at /precos (Centriu's central source — never restated here).
Frequently asked questions
Was this table actually being exploited before the fix?
The finding describes a genuine, confirmed database-level gap — a role with zero declared write access could write to this table directly. Whether it was ever actually exploited is a separate question this fix does not itself claim to answer; the fix closes the mechanism regardless.
Why did an earlier authorization pass in the same week not already catch this?
It deliberately excluded this specific table from its own scope at the time, judging it — incorrectly, as this fix's own account acknowledges — to be a minor opt-out flag rather than a genuine financial control affecting whether a real customer can use cashback they hold.
How can a table have a security gap if no application code ever writes to it?
Because a database platform's own default privileges are granted automatically the moment a table is created, entirely independent of whether any application code goes on to actually use it. The gap lived at that database-privilege layer, invisible to any review that only inspects application code.
Does this table still get read correctly by the systems that need it?
Yes — read access was left fully intact throughout; only insert, update, and delete privileges for unauthorized roles were revoked.
What is the general lesson this fix draws out about testing?
That measuring BEHAVIOR is not a substitute for measuring the underlying PRIVILEGE directly — a test that omitted revoking DELETE privilege showed no behavior change at all, simply because no DELETE policy had ever existed to matter, which could be mistaken for a working fix if only behavior, not the privilege itself, were checked.
What does Centriu Loop cost?
It is sold by subscription with a published starting price — exact current values are on the central pricing page.
See how Centriu Loop closes gaps its own code never even reaches
Reach our commercial team directly, or leave your details below — we'll follow up with guidance for your case.
