<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prajwal Saggurthi</title>
    <description>The latest articles on DEV Community by Prajwal Saggurthi (@prajwalsaggurthi).</description>
    <link>https://dev.to/prajwalsaggurthi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4282879%2F1f7d9e11-bc2f-4bf7-b3e7-83a92b210f1f.png</url>
      <title>DEV Community: Prajwal Saggurthi</title>
      <link>https://dev.to/prajwalsaggurthi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prajwalsaggurthi"/>
    <language>en</language>
    <item>
      <title>A rules-first workflow for Solidity audit contests with Claude Code subagents</title>
      <dc:creator>Prajwal Saggurthi</dc:creator>
      <pubDate>Fri, 04 Dec 2026 13:25:44 +0000</pubDate>
      <link>https://dev.to/prajwalsaggurthi/a-rules-first-workflow-for-solidity-audit-contests-with-claude-code-subagents-bje</link>
      <guid>https://dev.to/prajwalsaggurthi/a-rules-first-workflow-for-solidity-audit-contests-with-claude-code-subagents-bje</guid>
      <description>&lt;p&gt;Using an AI coding agent on a smart-contract audit contest without guardrails usually wastes hours in the same predictable ways: reading out-of-scope files, chasing issues already listed as known, or writing reports for theoretical bugs you cannot reproduce.&lt;/p&gt;

&lt;p&gt;A rules-first workflow with a dedicated local subagent keeps Claude Code doing the structured legwork while you keep control of judgement and submissions. The subagent reads locally, writes notes and tests locally, never submits anything, and never calls a contract "secure."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why contest findings get rejected
&lt;/h2&gt;

&lt;p&gt;Before touching Solidity code, it helps to look at the four main reasons findings are thrown out on platforms like Sherlock, Code4rena, Cantina, and Immunefi:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Out of scope.&lt;/strong&gt; The bug sits in a mock, a deployment script, an excluded dependency, or a commit different from the pinned contest hash.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Known issue.&lt;/strong&gt; The exact risk was already documented in the contest's known-issues list, README, or a previous audit report.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No PoC.&lt;/strong&gt; The report argues that something "could potentially" fail without a runnable proof of concept demonstrating concrete loss or broken functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duplicate.&lt;/strong&gt; The finding shares the same root cause as another issue you submitted, or it is already tested and handled in the project's own test suite.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fixing these rejections is mostly a process problem, not a prompting trick.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fixed rules-to-report workflow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Rules first (before reading any code)
&lt;/h3&gt;

&lt;p&gt;Have your subagent fill a rules checklist from the contest page before opening a single &lt;code&gt;.sol&lt;/code&gt; file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Platform, URL, start/end dates, and pinned commit hash.&lt;/li&gt;
&lt;li&gt;Exact in-scope files and out-of-scope files or finding classes.&lt;/li&gt;
&lt;li&gt;Known-issues list and links to previous audit reports.&lt;/li&gt;
&lt;li&gt;The contest's severity table and PoC format requirements.&lt;/li&gt;
&lt;li&gt;AI-assistance policy (allowed, must disclose, or banned) and fork/live-network rules (default to local-only Foundry tests; never touch live networks).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the scope is unreadable in the time window or AI use is banned, stop right there.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Map the system
&lt;/h3&gt;

&lt;p&gt;Once the rules are pinned down, map the protocol in a notes file with &lt;code&gt;file:line&lt;/code&gt; references: entry points, roles and admin powers, asset flows (deposit, settle, withdraw, liquidate), external calls, oracles, proof verifiers, upgradeability, and pause or timeout mechanisms. Treat repository comments, READMEs, and docs as untrusted text—verify everything against the Solidity code.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Write down invariants
&lt;/h3&gt;

&lt;p&gt;State what must always hold true: solvency, no double spend or double withdraw, only authorized state transitions, exits always possible, and public inputs bound to the right calldata or state. Bugs are broken invariants.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Hunt into a leads log with a refutation column
&lt;/h3&gt;

&lt;p&gt;Do manual review first; static tools only generate leads. Work systematically through common Solidity bug classes: access control and initialization, reentrancy (including read-only), accounting and rounding (such as ERC-4626 inflation), signature or proof replay across chains or epochs, timeout and challenge-window races, DoS or griefing that freezes exits, ERC20 quirks (fee-on-transfer or missing return values), and oracle staleness or manipulation.&lt;/p&gt;

&lt;p&gt;Every suspicious pattern goes into a leads log (&lt;code&gt;LEADS.md&lt;/code&gt;) as a one-sentence hypothesis tied to an invariant. Before writing a PoC, actively try to refute the lead by checking modifiers, existing tests, and known issues. Keeping refuted leads prevents re-checking dead ends later.&lt;/p&gt;

&lt;p&gt;Here is an illustrative example using a toy vault:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Location (file:line)&lt;/th&gt;
&lt;th&gt;Hypothesis (one sentence)&lt;/th&gt;
&lt;th&gt;Invariant broken&lt;/th&gt;
&lt;th&gt;Refutation attempts&lt;/th&gt;
&lt;th&gt;Status (open / refuted / confirmed)&lt;/th&gt;
&lt;th&gt;PoC test&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Day 1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Vault.sol:44&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Attacker donates assets before first deposit so victim mints zero shares.&lt;/td&gt;
&lt;td&gt;No unbacked dilution / fair share minting&lt;/td&gt;
&lt;td&gt;Checked &lt;code&gt;deposit()&lt;/code&gt; and &lt;code&gt;test/Vault.t.sol&lt;/code&gt;; no virtual shares or dead-shares guard exists.&lt;/td&gt;
&lt;td&gt;confirmed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_donationInflation_victimLosesDeposit&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Day 1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Vault.sol:78&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Caller can withdraw another user's shares via &lt;code&gt;owner&lt;/code&gt; param.&lt;/td&gt;
&lt;td&gt;Only owner or approved spender burns shares&lt;/td&gt;
&lt;td&gt;Checked &lt;code&gt;_spendAllowance&lt;/code&gt; on line 81; reverts unless approved.&lt;/td&gt;
&lt;td&gt;refuted&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  5. Run the 10-question triage filter
&lt;/h3&gt;

&lt;p&gt;Before writing a full report, force every surviving lead through ten yes/no questions. One "no" drops the finding:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Is the affected code in scope at the pinned commit?&lt;/li&gt;
&lt;li&gt;Is it absent from known issues and previous audits?&lt;/li&gt;
&lt;li&gt;Can an unprivileged user reach it (or a role the contest explicitly scopes)?&lt;/li&gt;
&lt;li&gt;Do preconditions hold in a realistic deployment, not only a contrived mock?&lt;/li&gt;
&lt;li&gt;Is the impact concrete—who loses what, or what stops working and for how long?&lt;/li&gt;
&lt;li&gt;Does a local Foundry test prove it with real run output?&lt;/li&gt;
&lt;li&gt;Does severity match the contest's own table?&lt;/li&gt;
&lt;li&gt;Does no existing check, modifier, test, or doc already prevent or explain it?&lt;/li&gt;
&lt;li&gt;Is it distinct from your other findings (different root cause)?&lt;/li&gt;
&lt;li&gt;Can you explain it to a judge in three sentences?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  6. Prove it with a local Foundry PoC
&lt;/h3&gt;

&lt;p&gt;No PoC, no finding. Build a minimal local Foundry test on the repository's own fixtures and mocks using a simple &lt;code&gt;setup / attack / assert&lt;/code&gt; shape. Keep &lt;code&gt;foundry.toml&lt;/code&gt; local-only (no live RPC endpoints or public-network transactions unless a contest explicitly scopes them), and run &lt;code&gt;forge test --match-test &amp;lt;testName&amp;gt; -vvv&lt;/code&gt; to capture real output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Local-only PoC skeleton (no live RPC forks unless explicitly scoped)
contract PoC is Test {
    function setUp() public {
        // Deploy or wire repo fixtures and fund actor accounts
    }

    function test_invariantBreak() public {
        // 1. Preconditions / initial state
        // 2. Attacker transaction sequence
        // 3. Assert concrete loss or broken invariant
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. Write one report per confirmed finding
&lt;/h3&gt;

&lt;p&gt;Only after &lt;code&gt;forge test&lt;/code&gt; passes against the exploit scenario—for example, a &lt;code&gt;[PASS] test_donationInflation_victimLosesDeposit()&lt;/code&gt; line on a toy vault—write one markdown report per finding. Include severity per the contest table, &lt;code&gt;file:line&lt;/code&gt; at the pinned commit, summary, root cause, step-by-step attack path, quantified impact, the exact &lt;code&gt;forge test&lt;/code&gt; command and pasted output from your run, a concrete fix, known-issue/duplicate notes, and AI disclosure if required by the contest.&lt;/p&gt;

&lt;p&gt;An empty findings list on a given codebase is a valid outcome; contest payouts are uncertain and often zero, and a subagent cannot judge off-chain components or economic design it cannot read. Review every line yourself before deciding what to submit.&lt;/p&gt;

&lt;p&gt;I packaged the Claude Code auditor subagent and templates here: &lt;a href="https://saggurthi4.gumroad.com/l/iitik" rel="noopener noreferrer"&gt;https://saggurthi4.gumroad.com/l/iitik&lt;/a&gt; (or as a bundle: &lt;a href="https://saggurthi4.gumroad.com/l/lviacf" rel="noopener noreferrer"&gt;https://saggurthi4.gumroad.com/l/lviacf&lt;/a&gt;). Code LAUNCH30 takes 30% off until 11 Dec.&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>security</category>
      <category>web3</category>
      <category>ai</category>
    </item>
    <item>
      <title>The 8 security holes AI-built Supabase/Firebase apps keep shipping (and how to check yours in 20 minutes)</title>
      <dc:creator>Prajwal Saggurthi</dc:creator>
      <pubDate>Fri, 04 Dec 2026 13:25:12 +0000</pubDate>
      <link>https://dev.to/prajwalsaggurthi/the-8-security-holes-ai-built-supabasefirebase-apps-keep-shipping-and-how-to-check-yours-in-20-1k30</link>
      <guid>https://dev.to/prajwalsaggurthi/the-8-security-holes-ai-built-supabasefirebase-apps-keep-shipping-and-how-to-check-yours-in-20-1k30</guid>
      <description>&lt;p&gt;Apps built quickly with Lovable, Bolt, Cursor, or Replit on top of Supabase or Firebase tend to ship with the same small set of security holes. Code generation gets features working fast, which often means access rules, secret boundaries, and webhook verification get skipped or stubbed out.&lt;/p&gt;

&lt;p&gt;You can check the most damaging ones yourself in about 20 minutes without buying any tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before you start:&lt;/strong&gt; only test code and apps you own or are explicitly authorized to review. Run every check against a staging or preview copy—never against live user data—and never paste secrets anywhere.&lt;/p&gt;

&lt;p&gt;Below are the eight issues that show up repeatedly, a bad-vs-good code or SQL fix for each, and a manual test you can run right away.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Row Level Security (RLS) left off
&lt;/h2&gt;

&lt;p&gt;When RLS is disabled on a Supabase table that holds user or business data, any request made with your public &lt;code&gt;anon&lt;/code&gt; key and a valid user token (or even unauthenticated, depending on grants) can read or write every row in that table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Bad: RLS disabled or never enabled on a user table&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;invoices&lt;/span&gt; &lt;span class="no"&gt;DISABLE&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt; &lt;span class="no"&gt;LEVEL&lt;/span&gt; &lt;span class="no"&gt;SECURITY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Good: enable RLS on every table holding user or business data&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;invoices&lt;/span&gt; &lt;span class="no"&gt;ENABLE&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt; &lt;span class="no"&gt;LEVEL&lt;/span&gt; &lt;span class="no"&gt;SECURITY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Sign into your staging app as test user A, copy user A's JWT from browser DevTools, and query a row belonging to test user B through the Supabase client or REST API. With RLS enabled and scoped properly, it should return zero rows or fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Policies written as &lt;code&gt;using (true)&lt;/code&gt; (or &lt;code&gt;if true&lt;/code&gt; in Firebase)
&lt;/h2&gt;

&lt;p&gt;Turning RLS on does not protect data if the policy itself is &lt;code&gt;USING (true)&lt;/code&gt;. That lets every authenticated user—and sometimes anonymous callers—access all rows in the table. In Firebase Firestore or Realtime Database, the equivalent mistake is &lt;code&gt;allow read, write: if true;&lt;/code&gt; or &lt;code&gt;".read": true&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Bad: any signed-in user can read every user's profile&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="s2"&gt;"read_profiles"&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;profiles&lt;/span&gt;
  &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Good: scope rows to the authenticated owner&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="s2"&gt;"read_own_profile"&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;profiles&lt;/span&gt;
  &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Authenticated as test user A on staging, run a &lt;code&gt;.select('*')&lt;/code&gt; filtered to test user B's &lt;code&gt;user_id&lt;/code&gt; from the browser console or a small test script. If user B's rows come back, tighten the policy to check &lt;code&gt;auth.uid()&lt;/code&gt; (or &lt;code&gt;request.auth&lt;/code&gt; and ownership in Firebase).&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;code&gt;service_role&lt;/code&gt; or secret keys in frontend code
&lt;/h2&gt;

&lt;p&gt;Supabase's &lt;code&gt;service_role&lt;/code&gt; key bypasses RLS completely. If a &lt;code&gt;service_role&lt;/code&gt; key, Stripe &lt;code&gt;sk_live_&lt;/code&gt; key, or private key sits inside &lt;code&gt;src/&lt;/code&gt;, &lt;code&gt;app/&lt;/code&gt;, &lt;code&gt;components/&lt;/code&gt;, &lt;code&gt;pages/&lt;/code&gt;, or &lt;code&gt;public/&lt;/code&gt;, it ships to every visitor's browser. Only &lt;code&gt;anon&lt;/code&gt; or publishable keys belong in frontend code. While checking, make sure &lt;code&gt;.env&lt;/code&gt; is git-ignored and absent from git history (&lt;code&gt;git log --all -- .env&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Bad: service_role key exposed in client-bundled code&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;supabase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Good: anon key in the browser; service_role only in a server or edge function&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;supabase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NEXT_PUBLIC_SUPABASE_ANON_KEY&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Check your built frontend bundle—not just your source files—by searching the production/preview build output or browser DevTools Sources tab for &lt;code&gt;service_role&lt;/code&gt;, &lt;code&gt;sk_live_&lt;/code&gt;, or &lt;code&gt;sk_test_&lt;/code&gt;. If anything secret appears there, rotate the key and move that call to a server route or edge function reading from environment variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Missing &lt;code&gt;with check&lt;/code&gt; on INSERT and UPDATE policies
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;USING&lt;/code&gt; clause controls which existing rows a user can see or target, whereas &lt;code&gt;INSERT&lt;/code&gt; and &lt;code&gt;UPDATE&lt;/code&gt; policies also need a &lt;code&gt;WITH CHECK&lt;/code&gt; clause. Without it—or with &lt;code&gt;WITH CHECK (true)&lt;/code&gt;—a user can insert or rewrite a row with another user's &lt;code&gt;user_id&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Bad: lets a caller write another user's user_id&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="s2"&gt;"insert_orders"&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
  &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Good: enforce that written rows belong to the caller&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;POLICY&lt;/span&gt; &lt;span class="s2"&gt;"insert_own_orders"&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
  &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Signed in as test user A on staging, attempt to insert or update a row with &lt;code&gt;user_id&lt;/code&gt; set to test user B's ID. The database must reject the write.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Unverified payment webhooks
&lt;/h2&gt;

&lt;p&gt;Payment webhook handlers for Stripe, Razorpay, or PayPal often read &lt;code&gt;req.body&lt;/code&gt; directly and mark an order paid. If the route does not verify the provider's cryptographic signature before trusting the body, anyone on the internet can POST a forged &lt;code&gt;payment succeeded&lt;/code&gt; event. Also ensure prices and amounts are read on the server, never trusted from the browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Bad: trusts unverified request JSON&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"checkout.session.completed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fulfillOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Good: verify signature against the raw body before acting&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rawBody&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"stripe-signature"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;stripe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;webhooks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;constructEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rawBody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;STRIPE_WEBHOOK_SECRET&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;"checkout.session.completed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fulfillOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Send a forged JSON &lt;code&gt;POST&lt;/code&gt; request with &lt;code&gt;curl&lt;/code&gt; and no valid signature header to your staging webhook endpoint. It must return &lt;code&gt;400&lt;/code&gt; or &lt;code&gt;401&lt;/code&gt; and leave order and payment state unchanged.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. IDOR via a record or user &lt;code&gt;id&lt;/code&gt; from the browser
&lt;/h2&gt;

&lt;p&gt;Custom API routes and edge functions frequently bypass RLS by using a server-side admin client, then trust an &lt;code&gt;id&lt;/code&gt; or &lt;code&gt;userId&lt;/code&gt; sent in the request body or URL params. Hiding an admin or edit button in the UI does not protect the API behind it. Identity must come from the verified session, and every route that reads or modifies a record must check ownership.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Bad: fetches any order ID supplied by the browser&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;adminClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;single&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Good: derive identity from the verified session and check ownership&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;sessionClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Unauthorized"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;adminClient&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"orders"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"user_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;single&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Log into staging as test user A, trigger a request that reads or updates one of user A's items, replay it with the &lt;code&gt;id&lt;/code&gt; swapped to one of test user B's items, and confirm the API rejects it instead of returning or modifying user B's record.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Wildcard CORS with credentials
&lt;/h2&gt;

&lt;p&gt;Calling &lt;code&gt;cors()&lt;/code&gt; with default or wildcard settings (&lt;code&gt;Access-Control-Allow-Origin: *&lt;/code&gt; or &lt;code&gt;origin: true&lt;/code&gt; combined with &lt;code&gt;credentials: true&lt;/code&gt;) allows untrusted websites to send authenticated requests to your API on behalf of a logged-in user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Bad: reflects any origin while allowing credentials&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Good: allowlist exact application origins&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"https://app.example.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; Run &lt;code&gt;curl -i -H "Origin: https://untrusted.example" https://your-staging-api.example/api/profile&lt;/code&gt; and read the response headers. You should not see &lt;code&gt;Access-Control-Allow-Origin: https://untrusted.example&lt;/code&gt; alongside &lt;code&gt;Access-Control-Allow-Credentials: true&lt;/code&gt;, nor &lt;code&gt;*&lt;/code&gt; with credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Raw HTML sinks like &lt;code&gt;dangerouslySetInnerHTML&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Passing user input—or AI-generated text influenced by user input—into &lt;code&gt;dangerouslySetInnerHTML&lt;/code&gt;, Vue's &lt;code&gt;v-html&lt;/code&gt;, or &lt;code&gt;innerHTML =&lt;/code&gt; opens the door to stored or reflected XSS. An attacker can execute JavaScript inside another user's browser session.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Bad: renders raw user-supplied HTML&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;__html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;comment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="c1"&gt;// Good: render as plain text (or sanitize with a vetted library if HTML is required)&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;comment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; On staging, submit a harmless probe string like &lt;code&gt;&amp;lt;b&amp;gt;test&amp;lt;/b&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;img src=x onerror=alert(1)&amp;gt;&lt;/code&gt; into any bio, comment, or message field that displays back on a page. Check the rendered DOM: it should appear as literal text, not parsed HTML elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting the 20-minute pass together
&lt;/h2&gt;

&lt;p&gt;Work through the checks in roughly this order on a staging copy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check frontend source, built bundles, and &lt;code&gt;.env&lt;/code&gt; history for exposed keys.&lt;/li&gt;
&lt;li&gt;Review every database table for RLS enabled, owner-scoped policies, &lt;code&gt;WITH CHECK&lt;/code&gt; clauses, and private storage buckets.&lt;/li&gt;
&lt;li&gt;Test API routes for session verification, ownership checks (IDOR), webhook signatures, CORS headers, and raw HTML sinks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pattern checks catch obvious mistakes fast, while manual checks catch the missing-code bugs—like absent ownership checks or client-trusted roles. Record every failure with &lt;code&gt;file:line&lt;/code&gt; evidence so each fix can be verified cleanly before launch.&lt;/p&gt;

&lt;p&gt;I packaged the scanner, checklist and report template as a kit: &lt;a href="https://saggurthi4.gumroad.com/l/pcenqc" rel="noopener noreferrer"&gt;https://saggurthi4.gumroad.com/l/pcenqc&lt;/a&gt; (code LAUNCH30 takes 30% off until 11 Dec)&lt;/p&gt;

</description>
      <category>security</category>
      <category>supabase</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
