laravel-security

Eliminate common Laravel security vulnerabilities with authentication, validation, and hardening practices.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel applications are frequently targeted by common web security threats including authentication bypass, CSRF attacks, SQL injection, XSS, and insecure file uploads, which can lead to data breaches, unauthorized access, and compliance violations. This Skill provides actionable, framework-specific best practices to eliminate these risks and secure Laravel applications end-to-end.

Core Features & Use Cases

  • Authentication & Access Control: Implement secure API authentication with Sanctum or Passport, enforce model-level authorization via policies and gates, and manage secure token lifecycles to prevent unauthorized resource access.
  • Input & Data Protection: Enforce strict input validation, mass assignment guards, encrypted database attributes, and parameterized queries to keep user data safe from tampering and injection attacks.
  • Production Hardening: Configure secure deployment settings, rate limiting, security headers, CORS policies, and secret management to protect live applications from abuse and exposure.
  • Use Case: When building a Laravel API that handles user invoice uploads, use this Skill to implement secure file validation, authenticated route access, and CSRF protection to prevent malicious file uploads and unauthorized data access.

Quick Start

Use the laravel-security skill to audit your existing Laravel application's authentication, input validation, and production configuration for security gaps and apply the recommended hardening best practices.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I prevent SQL injection and XSS vulnerabilities in Laravel applications?

To prevent SQL injection and XSS in Laravel, enforce strict input validation, use parameterized queries, and apply proper output escaping. This Skill provides framework-specific best practices to eliminate these common vulnerabilities and secure user data from tampering and injection attacks.

What is the best way to implement secure API authentication and authorization in Laravel?

Secure API authentication in Laravel is implemented using Sanctum or Passport, combined with model-level authorization via policies and gates. This approach enforces secure token lifecycles and prevents unauthorized resource access across your application's endpoints.

How do I secure file uploads in Laravel to prevent malicious files?

Securing file uploads in Laravel requires implementing strict file validation, authenticated route access, and proper CSRF protection. This Skill guides you through applying these controls to prevent malicious file uploads and unauthorized data access during form processing.

Does this Laravel security guidance cover production hardening and deployment configuration?

Yes, this Laravel security guidance covers production hardening by configuring secure deployment settings, rate limiting, security headers, CORS policies, and secret management to protect live applications from abuse and data exposure.

How do I audit an existing Laravel application for security gaps?

To audit an existing Laravel application for security gaps, review its authentication, input validation, and production configuration. This Skill helps identify vulnerabilities like mass assignment and insecure encrypted attributes, then apply recommended hardening best practices.