Security Basics

5 min

Repository Security Assessment for Live SaaS Apps

Repository Security Assessment for Live SaaS Apps

A repository tells the story of how your app handles trust. What a real assessment traces: exposed keys in Git history, missing ownership checks, RLS policy gaps, and payment flows that trust the client.

A repository tells the story of how your app handles trust. What a real assessment traces: exposed keys in Git history, missing ownership checks, RLS policy gaps, and payment flows that trust the client.

A repository security assessment is not a box-ticking exercise once your app is live. It is the fastest way to find the mistakes hiding between a rushed launch, an AI-generated feature branch, a Supabase project and a production API. One exposed service-role key or missing ownership check can turn a working product into a customer-data incident.

For founders, the question is not whether every line of code is elegant. It is whether an attacker can read another user's records, take over an account, call a privileged endpoint, alter a payment flow or use a leaked secret at your expense. A useful assessment answers that question with evidence, severity and exact next steps.

What a repository security assessment should examine

A repository tells the story of how your application handles trust. It shows where secrets enter the codebase, which requests are trusted, how users are identified and whether the frontend is being asked to enforce rules that belong on the server or in the database.

The first pass should look for exposed credentials: API keys committed to source control, .env files included by mistake, tokens embedded in JavaScript bundles and privileged Supabase keys used in browser code. A key can be valid even when it has been deleted from the current branch. Git history, deployment files, test fixtures and forgotten sample configurations all deserve review.

Authentication needs more than a check that users can sign in. Reviewers should trace how sessions, JWTs and password-reset links are created, stored and verified. Common problems include accepting unsigned or incorrectly validated JWTs, trusting a user ID supplied by the client, weak callback handling and endpoints that work without a valid session because a middleware rule was missed.

Authorisation is where many SaaS applications fail. An endpoint may correctly identify a signed-in user yet still allow that user to request another customer's invoice, workspace, message or uploaded file by changing an ID in the URL. This is insecure direct object reference, usually shortened to IDOR. It is particularly common in rapidly built dashboards and marketplace products because the happy path works perfectly during testing.

Database policy deserves the same scrutiny. With Supabase, row-level security (RLS) is a major control, not an optional extra. Tables with RLS disabled, policies that use an overly broad condition, or server-side code that bypasses policy without compensating checks can expose entire datasets. A repository review should compare migrations, policy definitions and application queries rather than assuming the database configuration is correct.

It should also inspect payment and operational workflows. For example, a client should not be able to mark an order as paid, set its own subscription tier or grant itself marketplace credit simply by calling an API route. Payment providers send signed webhooks for a reason. The server must validate those signatures, reconcile the event with internal records and make sensitive state changes on the trusted side of the boundary.

Why AI-built applications need closer review

AI assistance can accelerate a prototype into a live product in days. It can also produce code that looks credible while copying an unsafe pattern: a permissive CORS setting, a database query without an ownership filter, a secret placed in a public environment variable or an administrative endpoint protected only by a hidden URL.

The problem is not that AI-generated code is automatically insecure. The problem is that it often lacks the context that makes a security decision safe. A coding assistant may not know which routes are public, which users belong to which organisation, whether a Supabase client runs in the browser, or what happens when a payment webhook is retried.

Automated tools are valuable here. Secret scanners can identify known credential formats, dependency scanners can flag vulnerable packages, static analysis can spot risky patterns and web scanners can test the live application. But they cannot reliably determine whether GET /api/projects/:id returns only projects belonging to the current user. That requires manual review of the route, the database query and the assumptions around it.

A credible assessment combines both. Tools provide broad coverage and repeatable checks. Manual testing establishes exploitability, confirms false positives and finds business-logic flaws that scanners cannot infer. If a finding can be used to access real data or perform a real action, the report should say so clearly.

Repository security assessment findings that demand action

Not every issue deserves the same response. A development dependency with no production path is different from a leaked production key. Findings should be severity-rated according to what an attacker can actually do, how easily they can do it and what data or money is at stake.

Critical findings commonly include an exposed service-role key, publicly queryable customer tables, unauthenticated administrative actions or a confirmed IDOR allowing cross-account access. These should be contained immediately. Rotate credentials, revoke sessions where appropriate, disable the affected route or policy, and establish whether the exposure has already been used.

High-severity issues might include missing server-side ownership checks, weak webhook verification, vulnerable internet-facing dependencies or an authentication flow that permits account compromise under realistic conditions. They need prompt fixes before further growth, paid acquisition or a customer rollout increases the impact.

Medium and low findings still matter, but they should be scheduled intelligently. Missing Content Security Policy (CSP) or HSTS headers, overly broad CORS rules, verbose error messages and absent rate limiting can make other attacks easier or increase the blast radius. The right priority depends on the application. A marketing site and a SaaS platform handling customer records do not carry the same risk.

Good reports make this practical. Each item should identify the affected file path, endpoint, configuration or policy; explain the attack scenario; state the severity; and provide a specific fix. “Improve authorisation” is not actionable. “In app/api/invoices/[id]/route.ts, filter by both invoice ID and authenticated organisation ID before returning the record” is.

What the assessment process should look like

Speed matters when the app is already taking users, but speed should not mean a superficial scan. A focused engagement starts with repository access and the live application URL. The reviewer then maps the stack, identifies trust boundaries and runs automated checks alongside targeted manual tests.

The work should cover source code, environment handling, dependencies, authentication, API routes, database access, storage, payment integrations and browser-facing controls. For a Supabase application, that includes reviewing RLS policies, service-role key usage, storage bucket access and the distinction between anonymous, authenticated and server-side clients.

Live testing is necessary because repositories do not always match production. A secure policy committed locally may never have been deployed. Conversely, a production header or platform setting may reduce a risk that appears in code. Testing both surfaces closes that gap.

The output should be understandable to a founder and useful to an engineer. You need to know what is urgent, why it affects the business and who can fix it. Your developer needs enough detail to reproduce the issue and implement the correction without a chain of vague follow-up questions.

For small teams, there is a practical choice after the report. If you have engineering capacity, use the findings as a tightly scoped remediation plan and retest the high-severity items. If the same person is handling product, infrastructure and support, direct remediation can be the safer route. HollowByte can review the repository and live app, deliver severity-rated findings, then implement and verify agreed fixes where internal capacity is limited.

Security is a release discipline, not a one-off event

A repository review before launch is valuable, but the risk changes whenever you add a new role, integration, AI feature, database table or payment flow. The highest-risk moments are often the ones that feel routine: copying an old endpoint, exposing a new dashboard view, adding an admin shortcut or asking an AI tool to “wire up” a feature quickly.

Treat security checks as part of the release decision for changes that affect identity, money, customer data or permissions. Keep secrets out of repositories, enforce access rules where the data lives, verify every privileged server-side action and test with accounts that should not have access. The goal is not to slow product momentum. It is to avoid discovering, after growth has arrived, that trust was never enforced in the first place.

Back to blog

(function() { function applyMainRole() { var hero = document.getElementById('hero'); if (!hero) return false; var node = hero; while (node.parentElement && node.parentElement !== document.body) { node = node.parentElement; } if (node && node.parentElement === document.body) { node.setAttribute('role', 'main'); return true; } return false; } if (applyMainRole()) return; var attempts = 0; var interval = setInterval(function() { attempts++; if (applyMainRole() || attempts > 20) { clearInterval(interval); } }, 250); })();