# 🪺 Nhost Security Scanner - Find Public Leaks (`renzomacar/nhost-security-scanner`) Actor

Probes a public Nhost project's Hasura GraphQL endpoint for tables readable by anon role. Detects the #1 cause of Nhost data leaks: forgotten Hasura permission policies. Returns table-level counts + curl reproducer. Counts only.

- **URL**: https://apify.com/renzomacar/nhost-security-scanner.md
- **Developed by:** [Renzo Madueno](https://apify.com/renzomacar) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.65 / 1,000 security findings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Supabase RLS Security Scanner

Probes a public Supabase project for **Row-Level-Security misconfigurations**. Detects tables readable by the anon key (the #1 cause of Supabase data leaks). Returns table-level row counts and a verbatim curl command to reproduce each finding.

### Why this exists

The Supabase anon key is **meant to be public** — it ships in your frontend. The only thing keeping your tables private is Row-Level Security policies. When RLS is forgotten on even one table, the data is publicly readable to anyone with your URL + anon key.

Across 100+ Supabase projects I've audited, **22% leak user data anonymously** because RLS was forgotten on at least one table. This actor lets you check yours in 30 seconds.

### Input

```json
{
  "supabaseUrl": "https://your-project.supabase.co/",
  "anonKey": "eyJ...your-anon-public-key...",
  "tableHints": ["optional", "extra", "tables", "to", "probe"],
  "outputFormat": "both"
}
```

- **supabaseUrl** — your project URL from Supabase Dashboard → Project Settings → API.
- **anonKey** — your **anon/public** key (NOT service\_role). This is the same key you put in your frontend.
- **tableHints** — beyond ~40 common tables (users, profiles, orders, etc.) probed by default, list any schema-specific tables you'd like checked.
- **outputFormat** — `json` for programmatic use, `html-report` for human-readable HTML in KV store, `both` (default).

### Output

```json
{
  "projectRef": "abcdefgh",
  "url": "https://abcdefgh.supabase.co/",
  "scannedAt": "2026-05-12T15:00:00Z",
  "tablesProbed": 47,
  "findings": [
    {
      "table": "profiles",
      "readable": true,
      "count": 1843,
      "severity": "critical",
      "columns": ["id", "email", "full_name", "..."],
      "sensitiveColumns": ["email"],
      "reproducer": "curl 'https://.../rest/v1/profiles?select=*' -H 'apikey: <anon-key>' -H 'Prefer: count=exact' -H 'Range: 0-0' -I"
    }
  ],
  "summary": {
    "total_anon_readable": 3,
    "critical_count": 2,
    "high_count": 1,
    "medium_count": 0,
    "total_exposed_records": 2074
  },
  "next_steps": ["Rotate the anon key...", "For each finding ALTER TABLE...", "Re-run this scan..."],
  "paid_fix_offer": {
    "price_usd": 99,
  }
}
```

Plus a beautiful HTML report saved to the run's key-value store as `report.html`.

### Ethical use

- **Only scan projects you own** or have explicit permission to scan.
- Counts only, never row data: the scanner uses `Prefer: count=exact` + `Range: 0-0` to confirm a leak exists without exfiltrating contents.
- All findings remain private to the run owner unless explicitly shared.

### Related tools

- **CLI** (free, runs entirely on your machine): `npx @perufitlife/supabase-security --discover --url <URL> --key <KEY>`
- **Weekly auto-scan SaaS** ($29/mo): [rls-monitor.vercel.app](https://rls-monitor.vercel.app/)
- **Sister scanners**: Firebase, PocketBase, Appwrite, Nhost (search `@perufitlife` on npm).

Built and maintained by Renzo Madueño, founder of [Rotate Pilot](https://rotatepilot.com), aviation exam-prep software. Open source: [supabase-security-skill](https://github.com/Perufitlife/supabase-security-skill) · [GitHub](https://github.com/Perufitlife).

# Actor input Schema

## `graphqlUrl` (type: `string`):

Your Nhost project's Hasura GraphQL endpoint, e.g. https://abcdefgh.hasura.eu-central-1.nhost.run/v1/graphql. Find it in Nhost dashboard.

## `tableHints` (type: `array`):

Beyond ~30 common tables (users, accounts, etc.), list schema-specific tables to probe.

## `outputFormat` (type: `string`):

JSON for programmatic use; HTML for a human-readable report in KV store under report.html.

## Actor input object example

```json
{
  "graphqlUrl": "https://your-project.hasura.region.nhost.run/v1/graphql",
  "tableHints": [],
  "outputFormat": "both"
}
```

# Actor output Schema

## `results` (type: `string`):

All result items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "graphqlUrl": "https://your-project.hasura.region.nhost.run/v1/graphql"
};

// Run the Actor and wait for it to finish
const run = await client.actor("renzomacar/nhost-security-scanner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "graphqlUrl": "https://your-project.hasura.region.nhost.run/v1/graphql" }

# Run the Actor and wait for it to finish
run = client.actor("renzomacar/nhost-security-scanner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "graphqlUrl": "https://your-project.hasura.region.nhost.run/v1/graphql"
}' |
apify call renzomacar/nhost-security-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,renzomacar/nhost-security-scanner"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/1lnAt23mnBmvYDtMa/builds/86LXqMvffvVUWeutY/openapi.json
