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

DenyAllPermissionEvaluator Used As Silent Backup When Two PermissionEvaluator Beans Exist #44989

Closed
dcarrol3 opened this issue Apr 3, 2025 · 2 comments
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@dcarrol3
Copy link

dcarrol3 commented Apr 3, 2025

When two or more PermissionEvaluator beans are present in an application, Spring seems to silently choose the DenyAllPermissionEvaluator instead of failing to startup due to having duplicate beans.

This feels like a bug, and could have dangerous consequences for enterprises by silently pushing out code to production that seems to build/run as expected, but once an endpoint is hit that calls hasPermission(), it is always denied.

I think Spring should be failing at startup if there are multiple PermissionsEvaluators similar to behavior for other duplicate beans, or otherwise clearly warn developers of the case.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 3, 2025
@wilkinsona
Copy link
Member

Thanks for the report but this is out of Spring Boot's control. The default DenyAllPermissionEvaluator is being used due to this logic in Spring Security. With no unique PermissionEvaluator, null is returned which results in the default being used.

If you think this could be improved, please open a Spring Security issue.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2025
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 3, 2025
@dcarrol3
Copy link
Author

dcarrol3 commented Apr 3, 2025

Thanks. I'll open an issue over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants