Skip to content

Bug: auth.required middleware is not triggered on dynamic routes within app()->group() #327

Closed

Description

@patrickvuarnoz

I'm re-issuing this issue as it was not picked up (maybe not seen) in the leafsphp/auth repository. It's about the following issue: leafsphp/auth#32

This is a critical issue as it opens a huge security hole!

Activity

  1. mychidarko commented on Oct 17, 2026

    @mychidarko
    Member

    Thanks for the report, and sorry this sat for a while. This is fixed: v5 has had the fix since release (regression tests in tests/middleware.test.php reference #316 and #327), and it's now backported to v4.x (#335) and v3.x (#336), with patch releases on both branches. If you're still on Leaf 4, update to the latest v4 tag and it should go away. Related: #334 also fixed named middleware registered after routes being silently dropped. Reopen if you still hit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions