Skip to content
cccskills
FreePublished on GitHub

Laravel Mass Assignment and Authorization Review

Detects mass assignment via create/update($request->all()), unguarded models, and missing authorization on mutating controller actions in Laravel.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (4)

  • SKILL.md3.6 KB
  • fixtures/01-request-all-happy.md938 B
  • fixtures/02-validated-authorized-guard.md927 B
  • golden/01-request-all-happy.md876 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: mass assignment 脆弱性と認可漏れをチェックリスト型で検査する

Goal / 目的

  • create($request->all()) 等による mass assignment 脆弱性(公式が is_admin 注入による権限昇格を例示)を検出する。
  • 更新・削除系コントローラアクションの認可チェック漏れを検出する。

Non-goals / 扱わないこと

  • クエリ効率(laravel-eloquent-nplus1 のスコープ)。
  • バリデーションルールの網羅性(要件依存のため一律指摘しない)。
  • Gate と Policy の使い分けの強制(公式が混在を許容)。

Pre-execution Gate / 実行前ゲート

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

  • 差分にモデルの create / update / fill、またはコントローラの mutating アクションの追加変更が含まれている
  • diff コンテキストが利用可能である

ゲート不成立時の出力: NO_REVIEW: laravel-mass-assignment — 対象操作の変更なし

False-positive guards / 抑制条件

  • $request->all() でも直後に手動フィルタ / 明示カラム指定があれば安全。
  • CLI / seeder / 内部処理での forceFill / unguard は、ユーザー入力でなければ脆弱性ではない。
  • authorize(): true は認可を controller / middleware 側で実施していれば正当。
  • before() filter(admin 一括許可)がある場合、個別 policy メソッドに admin 分岐がないことを指摘しない。
  • Gate を使っていること自体は指摘しない(公式が Gate / Policy 混在を許容)。

Rule / ルール

  • ユーザー入力からのモデル作成・更新は $request->validated() / $request->safe()->only([...]) を使う($request->all() 直渡しを避ける)。
  • $guarded = [](全 unguarded)でユーザー入力を直接渡していないか確認する。
  • 更新・削除系アクションに認可(Gate::authorize / $user->can / can middleware / FormRequest authorize() のいずれか)があるか確認する。
  • 複雑・再利用される validation は FormRequest 化を推奨する。

Evidence / 根拠の取り方

  • 指摘は <file>:<line> で差分に紐づけ、公式規約(laravel.com/docs/12.x/eloquent#mass-assignment / authorization)を 1 行で添える。
  • 認可が diff 外の middleware にある可能性がある場合は断定せず questions で返す。

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

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

  • Finding: mass assignment / 認可漏れのどちらか(1文)
  • Impact: 権限昇格 / 不正データ更新
  • Fix: validated() / safe()->only() / 認可追加の最小案

Sources / 出典

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What this skill does>

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

画像・ボタン・フォーム要素に適切なアクセシブルネームがあるか確認する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

Ensure ADRs capture context, decision, alternatives, tradeoffs, and follow-ups in a way that prevents future drift.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

敵対的分析手法を統合したレビューの entry skill。認知バイアス対策の3手法 (Pre-mortem / War Game / Logic Torturing)と、宣言・主張と実態の乖離を突く claim-vs-actual 検出3パターン(Self-Contradiction / Refactor-Claim Audit / Cross-File Leakage)へルーティングし、通常のレビューでは見えない設計の盲点・ 防御の穴・論理の弱点・宣言と実装のズレを可視化する。

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

Review changes to the Agent Skills import/export bridge for path safety, round-trip fidelity, and validation correctness.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

Checks whether AI-assisted work defines review criteria, accessible context, explicit review loop, human judgment boundary, and feedback capture before delegating to an agent.

The English summary is being prepared. Showing the original description.

s977043/river-review7Updated Oct 24, 2026

See all skills by s977043

Report a problem with this skill