laravel-security

Apply security best practices to Laravel applications.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/dbrijesh/raep --skill laravel-security-dbrijesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/dbrijesh/raep/tree/main/templates/skills/laravel-security
Command: npx skills add https://github.com/dbrijesh/raep --skill laravel-security-dbrijesh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive security best practices for Laravel applications, helping to protect against common vulnerabilities and improve application security posture.

Core Features & Use Cases

  • Security Best Practices: Offers guidelines for securing Laravel apps, covering authentication, authorization, validation, CSRF protection, file uploads, secrets management, rate limiting, and secure deployment.
  • Middleware and Guards: Implements middleware for CSRF protection and security headers, as well as guards and policies for access control.
  • Validation and Data Sanitization: Ensures user input is validated and sanitized, reducing the risk of SQL injection and XSS attacks.
  • Password Security: Implements secure password handling and reset flows.
  • Rate Limiting: Adds abuse protection to authentication and write endpoints.
  • Secure Deployment: Recommends core security settings and session hardening.
  • API Exposure: Provides guidance on securing API endpoints and managing CORS.
  • Dependency Security: Suggests regular audits and updates for dependency management.

Quick Start

Run the 'laravel-security' skill to implement security best practices in your Laravel application.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I secure authentication and authorization in my Laravel application?

Secure Laravel authentication and authorization by implementing middleware for security headers, defining guards for access control, and applying policies to enforce proper user authorization across application resources.

What is the best way to prevent mass assignment and validate user input in Laravel?

Prevent mass assignment and validate user input in Laravel by applying strict validation rules to incoming requests and ensuring data sanitization to effectively reduce the risk of SQL injection and XSS attacks.

How does CSRF protection work for securing Laravel forms and API endpoints?

CSRF protection in Laravel works by utilizing middleware to verify tokens on incoming requests, safeguarding forms and API endpoints against cross-site request forgery while also managing CORS configurations.

Can I use Laravel rate limiting to protect authentication endpoints from abuse?

Yes, you can use Laravel rate limiting to add abuse protection specifically to authentication and write endpoints, restricting excessive requests and mitigating brute force attacks against the application.

What secure deployment settings are recommended for a Laravel application?

Secure Laravel deployment involves configuring core security settings, hardening session management, safely handling file uploads, protecting secrets, and performing regular dependency audits to improve overall security posture.

Why do I need to sanitize file uploads and manage secrets in Laravel?

Sanitizing file uploads and managing secrets in Laravel is essential to prevent malicious file execution and unauthorized access, ensuring sensitive configuration data remains protected during application deployment.