-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security][5.2.0 only bug] Default entry_point selection does not work for 2nd firewall #39249
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
@wouterj Can you have a look? |
Fiddling a little bit with the container pass, it looks the issue is more complex. It appear when there are multiple firewalls using |
This issue is provoked when there is a firewall with Here's a repository with the minimal code to reproduce it: https://github.com/romaricdrigon/reproducer-for-39249 |
Found it, the issue is that there is a I'm opening a PR in a few minutes. |
…eturning too early
…eturning too early
…as returning too early (romaricdrigon) This PR was merged into the 5.2 branch. Discussion ---------- [Security] fix #39249, default entry_point compiler pass was returning too early | Q | A | ------------- | --- | Branch? | 5.2 (bug introduced in 5.2.0, after RC2) | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39249 | License | MIT | Doc PR | N/A A `return` instead of `continue` was making compiler pass return after the first firewall. Hence subsequents firewalls never had a default entrypoint set. This issue would occur with all firewalls, with any type of authenticator, though I saw it first with `http_basic` - because it is a bit more opaque and harder to debug. Commits ------- c377805 [Security] fix #39249, default entry_point compiler pass was returning too early
* 5.2: Fix rate limiter documentation Fix merge. fix lexing mapping values with trailing whitespaces [String] Fix Notice when argument is empty string [Inflector] Fix Notice when argument is empty string [Security] fix #39262, more defensive PasswordMigratingListener [Workflow] Fixed case when the marking store is not defined [Security] fix #39249, default entry_point compiler pass was returning too early Fix small typos
Symfony version(s) affected: 5.2.0 with new authenticator system
5.2.0-RC2 was not affected
Description
Using security configuration below, I will get a 401 error.
HttpBasicAuthenticator::start()
is not called, so it won't have the correctWWW-Authenticate
header. And then authentication will never work (in browsers).How to reproduce
Updated, see reproducer below: https://github.com/romaricdrigon/reproducer-for-39249
With thissecurity.yaml
:Workaround for other users affected
A temporary workaround is to make sure to define
entry_point
- though there's a small catch about which key to use, you should use service name:Possible Solution
I believe this issue was introduced by #39153
I suspect that
http_basic
authenticator is not part of those. I will have a look at a possible fix asap, but I'm not sure to fully grasp all details yet.The text was updated successfully, but these errors were encountered: