laravel-authorization-review

Audits Laravel route authorization chains for broken object-level access controls.

Updated Jan 6, 2023
One-click install
npx skills add https://github.com/pekral/phpstan-rules --skill laravel-authorization-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-authorization-review
Source: https://github.com/pekral/phpstan-rules/tree/main/.claude/skills/laravel-authorization-review
Command: npx skills add https://github.com/pekral/phpstan-rules --skill laravel-authorization-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the critical security gap of broken object-level authorization (IDOR/BOLA) in Laravel applications, which automated scanners often miss because they cannot interpret developer intent regarding data ownership.

Core Features & Use Cases

  • Route Inventory Analysis: Uses artisan route:list to create a ground-truth map of every endpoint and its middleware.
  • Authorization Chain Audit: Validates the four layers of Laravel security: authentication, authorization, object scoping, and policy coverage.
  • Use Case: Use this during a pull request review to verify that a new endpoint correctly scopes database queries to the authenticated user, preventing cross-account data leaks.

Quick Start

Run the laravel authorization review skill to audit all routes in the current project and generate a security coverage report.

Frequently Asked Questions about laravel-authorization-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Laravel authorization for IDOR vulnerabilities?

Auditing Laravel authorization for IDOR involves analyzing middleware, policies, gates, and Eloquent query scoping across all routes to identify broken access control. It verifies database queries correctly scope to the authenticated user, preventing cross-account data leaks.

What is broken object-level authorization in PHP Laravel applications?

Broken object-level authorization in Laravel is an access control vulnerability where endpoints fail to scope Eloquent database queries to the authenticated user. This IDOR risk allows cross-account data access because automated scanners cannot interpret developer intent regarding data ownership.

Can I use artisan route:list to map Laravel middleware for security coverage?

Yes, you can use artisan route:list to map Laravel middleware for security coverage. Executing this read-only command creates a ground-truth inventory of every endpoint, allowing you to validate authentication and policy coverage across all application routes.

How do I check Laravel policies and gates during a pull request review?

To check Laravel policies and gates during a pull request review, validate the four security layers: authentication, authorization, object scoping, and policy coverage. Verify that new endpoints correctly scope database queries to prevent cross-account data leaks.

Do I need project root access to run a Laravel access control audit?

Yes, you need project root access to run a Laravel access control audit. The analysis requires the ability to execute read-only artisan commands to map the route inventory and analyze the application's complete authorization chain.

What is the best way to find BOLA vulnerabilities in Laravel Eloquent queries?

The best way to find BOLA vulnerabilities in Laravel is auditing Eloquent query scoping across all mapped routes. Analyze the full authorization chain to ensure endpoints enforce data ownership and prevent cross-account data leaks.