Next.js Server Action Security Review

Next.js Server Action Security Review is a skill for Claude Code from s977043/river-review. It costs 46 tokens per session (1,201 once invoked), scanned A, original, MIT.

A security review rule for Next.js Server Actions, which are server functions callable from a web page. It treats each action like a public HTTP endpoint.

In plain words
What is it for?
It reviews "use server" actions that create, update, or delete data, checking user access, resource ownership, validated inputs, and untrusted identifiers.
Why use it?
It catches mutations that lack authentication, permission checks, input validation, or verification of client-provided IDs before changing data or processing payments.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the river-review plugin — 139 skills, 18 commands, 5 agents, 3 hooks shipped together

Good fit It reviews "use server" actions that create, update, or delete data, checking user access, resource ownership, validated inputs, and untrusted identifiers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s977043/river-review/nextjs-server-action-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add s977043/river-review --skill nextjs-server-action-security
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 139 skills, 18 commands, 5 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Next.js Server Action Security Review

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/river-review/nextjs-server-action-security/github.svg)](https://agentmods.dev/skills/s977043/river-review/nextjs-server-action-security)
Your own site
<a href="https://agentmods.dev/skills/s977043/river-review/nextjs-server-action-security"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nextjs-server-action-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Next.js Server Action Security Review

Your own site · 80×15
<a href="https://agentmods.dev/skills/s977043/river-review/nextjs-server-action-security"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nextjs-server-action-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,201 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.01201
Opus 5.5 $0.00018 $0.00480
Sonnet 5.5 $0.00009 $0.00240
Haiku 4.5 $0.00005 $0.00120

Measured 1mo ago against content hash 3894a9b5add3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Next.js Server Action Security Review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin-dist/river-review/skills/midstream/nextjs-server-action-security/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: Server Action を「誰でも呼べる公開エンドポイント」と仮定し、認証・認可・入力検証の欠落をチェックリスト型で検査する。

Goal / 目的

  • 'use server' で公開される Server Action は 認証なしに誰でも呼べる公開 HTTP エンドポイントである、という前提に立つ。
  • mutation(DB の更新・削除・課金など)前に、セッション/認証と認可(リソース所有者確認)が検証されていない欠落を検出する。
  • formData や引数を検証せず DB へ直接渡す入力バリデーション欠如、クライアントから渡る ID をなりすまし可能なまま信頼する誤りを検出する。

Non-goals / 扱わないこと

  • client/server 境界判定(use client 誤用)は nextjs-app-router-boundary の領域。本スキルでは扱わない。
  • read-only の Server Action(mutation を伴わないもの)への認可指摘。
  • 認証ライブラリ・バリデーションライブラリの選定や設計全般。
  • CSRF / レート制限などインフラ層の防御(フレームワーク・基盤の責務)。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。

  • 差分に 'use server' 関数 / Server Action(actions.ts など)の追加・変更が含まれている
  • diff コンテキストが利用可能である

ゲート不成立時の出力: NO_REVIEW: nextjs-server-action-security — Server Action の変更なし

False-positive guards / 抑制条件

  • 認証チェックを共通ヘルパー(requireUser() / requireAuth() 等)に委譲しており、差分内にその呼び出しが見える場合は指摘しない。
  • 公開フォーム(問い合わせ・ニュースレター登録など、認証不要が要件上正当なもの)で、その旨がコメントで明記されている mutation は、認可指摘を質問に留める。
  • read-only の Server Action(mutation なし)は認可指摘の対象外。
  • 入力検証を共通ヘルパーやスキーマ(zod 等)へ委譲し、差分内でその呼び出しが見える場合は指摘しない。

Rule / ルール

  • mutation を行う Server Action は、処理前に認証(例: auth() / getServerSession() / requireUser() 等)でセッションを確認する。
  • mutation 対象がユーザー固有リソースなら、認可(リソース所有者がセッションユーザーと一致するか)を確認する。
  • formData / 引数は zod 等で検証してから利用する。型は信頼できない(Server Action の引数はクライアント由来)。
  • formData.get('userId') のようにクライアントから渡る ID を所有者として信頼しない。所有者はセッションから導出する。

Evidence / 根拠の取り方

  • 指摘は <file>:<line> で差分に紐づけ、mutation 呼び出しと認証/認可/検証の欠落箇所を併記する。
  • 抑制条件に該当しないこと(差分内にヘルパー呼び出しが見えないこと)を根拠として示す。

Output / 出力(短文版の推奨)

コメントは日本語で返す。

  • Finding: どの防御が欠落しているか(1文)
  • Impact: 不正な mutation / なりすまし / 不正入力の DB 反映 等
  • Fix: 認証チェック / 所有者確認 / zod 検証の最小修正案

Sources / 出典

Read the full file on GitHub · 78 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 78 lines · 46 tokens per session scan A 3894a9b5add3

Subscribe to this mod's changes

Next.js Server Action Security Review is a skill published in the GitHub repository s977043/river-review (7 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 1,201 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

python-services

Python patterns for CLI tools, async parallelism, and backend services. Use when building CLI apps, async/parallel Python, FastAPI services, background jobs, or configuring Python project tooling (uv, ruff, ty).

iliaal/whetstone · 48 tokens

nodejs-backend

Node.js backend patterns: framework selection, layered architecture, TypeScript, validation, error handling, security, production deployment. Use when building REST APIs, Express/Fastify servers, microservices, or server-side TypeScript.

iliaal/whetstone · 50 tokens

ia-php-laravel

Modern PHP 8.4 and Laravel patterns: architecture, Eloquent, migrations, queues, testing. Use when working with Laravel, Eloquent, Blade, artisan, or building/testing a framework-based PHP app. Not for php-src internals, standalone PHP libraries, or general PHP language discussion.

iliaal/whetstone · 67 tokens

php-laravel

Modern PHP 8.2+ and Laravel patterns: architecture, Eloquent, queues, Pest testing. Use when asked to "write PHP", "build a Laravel app", "fix Eloquent query", "add a queue job", "write a Pest test", or mentions PHP, Laravel, Eloquent, Blade, artisan, or migrations.

iliaal/whetstone · 74 tokens

run-iteration-eval

Run the Logic-Lens content-eval pipeline for one iteration and produce a scored summary.json — use to measure a skill change. Wraps scripts/run-content-evals.sh (runner, costs tokens) and scripts/grade-iteration.py (grader, free, re-runnable). ALWAYS sync the plugin cache first. Use when the user wants to "run the…

hyhmrright/logic-lens · 108 tokens

api-contract

API contract & type-safety audit of changed code: breaking signature/route/response changes without versioning, schema drift, serialization issues, any/cast at boundaries, back-compat-breaking enum/union changes. Use for API contract review, back-compat check, schema or type-boundary audit of a diff.

tufantunc/review-pro · 67 tokens