Skip to content

AccessDeniedException returns 500 instead of 403 when no firewall is defined. #34148

Closed
@theredled

Description

@theredled

Symfony version(s) affected: 3.4.32

Description
When you throw a AccessDeniedException in a controller and no firewall is defined, a 500 error code is given instead of the expected 403.

How to reproduce

  • make a new project (symfony new app)
  • in a new controller/action, write throw new AccessDeniedException(); or throw $this->createAccessDeniedException();
  • call page
  • a 500 error is raised.

Expected
A 403 error should be raised.

Notes
I know there are similar issues but they all are closed without having been fixed - for what I've seen.
(#15236 #11663 #19906 #8467 #20233)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy