You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony\\Component\\Security\\Http\\Authenticator\\Passport\\Credentials\\PasswordCredentials::__construct(): Argument #1 ($password) must be of type string, array given, called in /var/www/app/vendor/symfony/security-http/Authenticator/FormLoginAuthenticator.php on line 85
How to reproduce
Post array data for the password to a form login
curl -X POST --data '_username=foo&_password[]=bar' http://app.dev/login_check
Possible Solution
I saw that for the username there is a check in place:
if (!\is_string($credentials['username']) && !$credentials['username'] instanceof \Stringable) {
Maybe we can do the same for the password? Happy to contribute this if it makes sense
Additional Context
Actually in dev mode there is another issue with the data collector:
TypeError:
rawurlencode(): Argument #1 ($string) must be of type string, array given
at /var/www/app/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php:127
The text was updated successfully, but these errors were encountered:
…sword (dmaicher)
This PR was squashed before being merged into the 5.4 branch.
Discussion
----------
[Security] FormLoginAuthenticator: fail for non-string password
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#51441
| License | MIT
| Doc PR | -
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the latest branch.
- For new features, provide some code snippets to help understand usage.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Fixes#51441 by handling it similar to the username and throwing a `BadRequestHttpException`.
Commits
-------
dc5660e [Security] FormLoginAuthenticator: fail for non-string password
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
5.4+
Description
How to reproduce
Post array data for the password to a form login
Possible Solution
I saw that for the username there is a check in place:
symfony/src/Symfony/Component/Security/Http/Authenticator/FormLoginAuthenticator.php
Line 126 in 6126caf
Maybe we can do the same for the password? Happy to contribute this if it makes sense
Additional Context
Actually in dev mode there is another issue with the data collector:
The text was updated successfully, but these errors were encountered: