More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    nextjs auth rbac reviewer

    1

    Review Next.js App Router server actions and route handlers for RBAC gaps, tenant leaks, and IDOR vulnerabilities.

    Free

    Security scanned
    nextjs auth rbac reviewer

    nextjs auth rbac reviewer

    Example session with this skill installed

    Use nextjs-auth-rbac-reviewer on app/actions/applications.ts.
    Users sign in with Google. Each user may only view and change their own
    internship applications. Read-only review please.

    • Read your context and instructions
    • Compiled the nextjs auth rbac

    Synthetic example. Illustrative of the output format. It is not from a
    real project and not a recorded agent session.

    A. Scope and limitations

    • Reviewed: app/actions/applications.ts, lib/auth.ts, lib/db.ts
    • Next.js version: not determinable from supplied files. Auth: Google OAuth
      via a getSession() helper
    • Access model: stated by user (own applications only; no admin role)
    • No commands run. Nothing executed or tested.

    B. Authorization-boundary summary

    Entry pointAuth checkRole checkOwnership check
    moveApplication (server action)Yes (getSession)n/aNo
    listApplications (server action)Yesn/aYes (where: { userId })

    C. Findings

    F-1: Any signed-in user can change another user's application status

    • Severity: High. A signed-in user who obtains or guesses another
      application's id could alter that user's records.
    • Confidence: High
    • Location: app/actions/applications.ts, lines 9–11, moveApplication
    • Evidence: the Zod schema validates that status is an allowed value,
      which checks shape, not authority. getSession() (read in lib/auth.ts)
      returns identity only. db.application.update filters by id alone. No
      wrapper or middleware covering this action was found in the supplied files.
    • Preconditions: any valid session and a target application id.
    • Impact: unauthorized modification of another user's records.
    • Fix: scope the write to the session user, for example
      where: { id, userId: session.user.id } with updateMany, and treat a
      zero-row result as "not found."
    • Regression test: user B calls moveApplication on user A's
      application → rejected and record unchanged; user A on their own → succeeds.
    • Verification: observed (code read); not tested.

    listApplications is scoped by userId in the query. No supported
    finding for that action.

    D. Suggested regression tests

    1. No session → rejected
    2. User B modifies user A's application → rejected, record unchanged
    3. User A modifies their own application → succeeds
    4. Invalid status value → rejected by validation

    E. Unresolved questions and uninspected areas

    • Route handlers, middleware, and any agent or MCP tool handlers that call
      moveApplication were not supplied.
    • Client components were not inspected.

    F. Commands run

    None run.

    Next steps: apply the scoped write, add the four tests, then re-run the
    review on any agent tool handlers that reuse this logic.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Securing Next.js applications requires more than just middleware. This skill solves the problem of "silent" authorization leaks where server actions, route handlers, or AI agent tools lack proper ownership checks or tenant isolation. It prevents common IDOR vulnerabilities and client-side gating mistakes that standard linters miss.

    What it does

    • Entry point mapping identifies every server action, route handler, and server component to ensure no boundary is overlooked.
    • Trace authorization follows the logic from the request through to the ORM or database query to verify resource ownership.
    • Tenant leak detection flags instances where a user can access or mutate another user's data by simply providing a resource ID.
    • Client-only gate detection finds UI-level role checks that aren't backed by server-side enforcement.
    • Regression test generation provides specific test cases for Vitest or Jest to ensure fixes remain in place.

    How it works

    1. Analyze environment to detect Next.js versions, auth libraries like Auth.js or Clerk, and the intended role model.
    2. Scan entry points including "use server" actions and route.ts files to build an attack surface map.
    3. Inspect data access by tracing symbols into Prisma, Drizzle, or SQL calls to check for missing where clauses on user IDs.
    4. Generate findings with severity ratings, code evidence, and framework-agnostic or tool-specific test cases.

    Frameworks & tools

    Specifically designed for Next.js App Router and Pages Router. Works with common auth providers like Auth.js (NextAuth), Clerk, and Kinde, as well as ORMs like Prisma and Drizzle.

    Why this beats prompting it yourself

    Generic prompts often miss the nuance of how Next.js server actions bypass standard middleware or how AI agent tool handlers can be exploited as unsecured endpoints. This skill uses a systematic workflow to ensure every data-fetching boundary is validated against your actual access model, not just "best practices."

    Use cases

    • Reviewing a new feature's server actions for IDOR vulnerabilities before a PR merge.
    • Auditing a multi-tenant application to ensure users cannot view other tenants' records.
    • Verifying that sensitive AI agent tools have the same permission checks as the web UI.
    • Scaffolding a regression test suite for a legacy Next.js codebase.

    Known limitations

    This is a read-only review of authorization logic. It does not perform dependency scanning, cryptographic audits, or penetration testing, and requires access to the project files or code excerpts.

    Read-only review of access control logic only. No support for non-Next.js frameworks. Cannot detect infrastructure-level or cryptographic vulnerabilities. Requires source code access.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    • Free with an Agensi account

    Permissions

    Read Files
    Network Access

    File Scopes

    app/**
    src/app/**
    pages/api/**
    middleware.ts
    proxy.ts
    lib/**
    src/lib/**
    package.json
    *.test.ts

    Read-only. Never writes files, runs commands, or makes network calls unless the user explicitly grants permission.

    Listed14 days ago

    What's inside

    Frequently Asked Questions

    The skill maps every server action and route handler to trace data flow through your ORM, identifying gaps where resource ownership (IDOR) or tenant isolation checks are missing—common issues that standard linters and middleware often overlook.

    It is purpose-built for the Next.js App Router and Pages Router, offering deep integration with popular auth providers like Auth.js, Clerk, and Kinde, as well as ORMs including Prisma and Drizzle.

    Yes, the skill is specifically designed to audit the tool handlers used by AI agents, ensuring that these programmatic endpoints have the same rigorous RBAC and ownership checks as your standard web UI.

    Upon purchase, you receive the full agent skill workflow designed for your AI IDE or agent platform, including the systematic scanning logic and templates for generating regression tests in Vitest or Jest.

    The skill requires access to your project's source code (specifically server actions, route handlers, and data schema) to perform its analysis, but it operates in a read-only capacity and does not modify your files.

    No, the skill is framework-agnostic regarding your data model; it simply requires you to define your intended role and tenant structure during the initial environment analysis phase.

    No. It is read-only and only suggests fixes and tests.

    No. It reports "No supported findings within the inspected scope" and lists what it did not inspect.

    It identifies them from your project evidence instead of assuming. Custom or unfamiliar auth is described and marked "inferred."

    It is designed to trace middleware, wrappers, and query scoping before reporting a missing check. If you see a false positive, please report it.

    Only if you give explicit permission. Otherwise it only proposes tests.

    Best-effort only. It is built for the App Router.

    New in Code Quality & Review