laravel-security

Configure Laravel security controls for authentication, validation, and CSRF protection.

Updated May 9, 2026
One-click install
npx skills add https://github.com/kk20300113-png/my-claude-skills --skill laravel-security-kk20300113-png
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/kk20300113-png/my-claude-skills/tree/main/laravel-security
Command: npx skills add https://github.com/kk20300113-png/my-claude-skills --skill laravel-security-kk20300113-png

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel applications are prone to common web attacks including CSRF, SQL injection, insecure authentication, and data exfiltration if security best practices are not consistently implemented. This Skill provides actionable, framework-specific guidance to eliminate these risks and harden Laravel codebases for production use.

Core Features & Use Cases

  • Comprehensive Security Coverage: Includes guidance for authentication/authorization (Sanctum/Passport), input validation, CSRF protection, mass assignment guards, secure file uploads, and production deployment hardening.
  • Concrete Implementation Examples: Provides ready-to-use code snippets for common security controls like rate limiting, encrypted attributes, signed URLs, and security headers.
  • Use Case: When building a new Laravel API endpoint that handles sensitive user data, use this Skill to implement proper rate limiting, authorization checks, and input validation to prevent unauthorized access and injection attacks.

Quick Start

Use the laravel-security skill to audit your Laravel application's current authentication, input validation, and session security configurations for potential vulnerabilities.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I prevent CSRF attacks in my Laravel application?

To prevent CSRF attacks in Laravel, you need to enforce CSRF protection tokens on all state-changing HTTP requests. This Skill provides actionable guidance and configuration steps to secure session and cookie settings against cross-site request forgery vulnerabilities.

What is the best way to configure Laravel authentication and authorization?

The best way to configure Laravel authentication is by implementing robust access controls using Sanctum or Passport. This Skill provides framework-specific guidance for setting up secure authentication and authorization to prevent unauthorized access to your API endpoints.

How do I secure file uploads and validate user input in Laravel?

To secure file uploads in Laravel, you must enforce strict user input validation and restrict file types. This Skill offers ready-to-use code snippets for secure file upload handling and input validation to prevent injection attacks and malicious file execution.

How do I prevent mass assignment and SQL injection vulnerabilities in Laravel?

Preventing mass assignment in Laravel requires defining $fillable properties on models, while stopping SQL injection requires proper query binding. This Skill guides you through implementing these guards to mitigate data exfiltration and mass assignment risks.

How can I implement API rate limiting and security headers for a Laravel production deployment?

Implementing API rate limiting in Laravel involves configuring throttle middleware, while adding security headers requires modifying HTTP responses. This Skill provides concrete implementation examples for production deployment hardening and protecting sensitive credentials.

Does this Laravel security guidance cover mitigating XSS and data exfiltration risks?

Yes, this Laravel security guidance covers mitigating XSS and data exfiltration risks by enforcing output escaping and encrypting sensitive attributes. It provides actionable steps to eliminate common web vulnerabilities and harden your codebase for production use.