-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Using IsGranted in combination with MapRequestPayload passes incorrect subject to voter #50964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is actually expected behavior, see #50120 |
It isn't really expected behavior though. It has been accepted as a 'fix this later'. #50125 (review)
In our case we do not necessarily need the deserialized payload though, working with a simply |
Yes, it is. This is not a bug. |
Thank you for this suggestion. |
Could I get a reply or should I close this? |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
6.3.0
Description
Using the
IsGranted
attribute in combination with theMapRequestPayload
results in the wrong subject being passed into the voters.What I expected was that my voter would receive a DTO class (
ExampleDTO
) or atleast theclass-string
when thesupports
method gets called by symfony for the$subject
argument, instead what I got was$subject
of typeMapRequestPayload
which is the attribute of the controller argument.How to reproduce
Controller route
DTO
Customer DTO Attribute
Custom DTO voter
Possible Solution
symfony/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php
Line 101 in aef6429
Additional Context
No response
The text was updated successfully, but these errors were encountered: