laravel-auth-hardening

Implement anti-enumeration patterns and Sanctum token revocation tests for Laravel authentication hardening.

3|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/ai-enhanced-engineer/aiee-skills --skill laravel-auth-hardening
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-auth-hardening
Source: https://github.com/ai-enhanced-engineer/aiee-skills/tree/main/skills/laravel-auth-hardening
Command: npx skills add https://github.com/ai-enhanced-engineer/aiee-skills --skill laravel-auth-hardening

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses common security vulnerabilities in Laravel authentication, such as enumeration, role-based privilege escalation, and token revocation issues.

Core Features & Use Cases

  • Anti-Enumeration: Prevents revealing the existence of accounts through authentication endpoints.
  • Role Allowlist Discipline: Ensures that roles are not mass-assigned and are securely managed.
  • Sanctum Token Revocation: Tests and enforces the revocation of Sanctum tokens.
  • Null-Safe Ownership Comparisons: Safely compares user identity with model relations.
  • Vulnerability-Class Thinking: Applies security measures across all relevant endpoints.
  • Use Case: When implementing or auditing Laravel authentication, use this Skill to harden your application against common security threats.

Quick Start

Run the 'laravel-auth-hardening' skill to review and harden your Laravel authentication system.

Frequently Asked Questions about laravel-auth-hardening

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

FAQPage Schema
How do I prevent user enumeration in Laravel authentication endpoints?

Prevent user enumeration in Laravel authentication by implementing anti-enumeration patterns that stop endpoints from revealing whether an account exists. This Skill applies vulnerability-class thinking to ensure login and registration responses do not leak valid identifiers.

What is the best way to enforce role allowlist discipline in Laravel?

Enforce role allowlist discipline in Laravel by securely managing roles to prevent mass assignment vulnerabilities. This Skill ensures roles are explicitly defined and protected, mitigating the risk of role-based privilege escalation during authentication.

How do I test Sanctum token revocation in a Laravel application?

Test Sanctum token revocation in Laravel by implementing tests that explicitly verify revoked tokens are immediately invalidated. This Skill hardens authentication by enforcing token revocation rules across all relevant API endpoints.

Why do I need null-safe ownership comparisons for Laravel models?

Null-safe ownership comparisons in Laravel are needed to safely compare user identity with model relations without throwing errors. This Skill implements secure comparisons to prevent authentication bypasses when relation data is unexpectedly null.

Can I use this Laravel authentication hardening approach for auditing existing applications?

Yes, you can use this Laravel authentication hardening approach for auditing existing applications. The Skill applies vulnerability-class thinking to review and strengthen current authentication systems against enumeration, token revocation, and privilege escalation issues.

What security vulnerabilities does Laravel authentication hardening address?

Laravel authentication hardening addresses security vulnerabilities including account enumeration, role-based privilege escalation, and Sanctum token revocation issues. This Skill systematically applies security measures across endpoints to resolve these common threats.