Skip to content
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

[Security] Correctly initialize the voter property #54248

Merged
merged 1 commit into from Mar 14, 2024

Conversation

aschempp
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues #54225
License MIT

This fixes the basic issue that causes #54225. If getVoters() returns an empty array, the $this->data['voters'] property is never initialized, and therefore returns an invalid value.

@fritzmg or I will follow up if necessary with a fix about decorated access decision managers that cannot "provide" their voters for tracing.

@aschempp
Copy link
Contributor Author

The fabbot.io check errors seem unrelated to the pull request.

@nicolas-grekas
Copy link
Member

Can you please add a test case?

@aschempp
Copy link
Contributor Author

Sure thing, test added. I reverted the change so you can see the test failing and then re-added the fix 🙃

@stof
Copy link
Member

stof commented Mar 14, 2024

@aschempp it looks like you forgot to re-add the fix

@aschempp
Copy link
Contributor Author

Sorry about that, I pushed now. I had to wait for the queue to fail and went off to something else 🙈

@nicolas-grekas
Copy link
Member

Thank you @aschempp.

@nicolas-grekas nicolas-grekas merged commit 3fbca7b into symfony:5.4 Mar 14, 2024
8 of 12 checks passed
@aschempp aschempp deleted the fix/empty-voters branch March 14, 2024 13:07
This was referenced Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants