Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] don't do nested calls to serialize()#30006
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think this is the best approach we can achieve for 3.4.
For master, we should deprecate extending serialize/unserialize and provide another API that returns/accepts arrays instead.
nicolas-grekas commentedJan 28, 2019
@stof I'd be happy to have your 👍 here :) |
stof commentedJan 28, 2019
@nicolas-grekas Would this |
stof commentedJan 28, 2019
I suggest looking at what the PHP RFC for |
nicolas-grekas commentedJan 28, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's correct, For master:
I thought of a slightly different plan: we should mark |
stof commentedJan 28, 2019
But they probably cannot add an actual parameter there. We don't even expect them to do it (we expect them to add it when doing the |
nicolas-grekas commentedJan 28, 2019
So, we remove the annotation and we plan for master. Works for me. OK for you with my proposal for master? |
stof commentedJan 28, 2019
So in your plan, switching to |
nicolas-grekas commentedJan 28, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Correct. @renanbr could you please remove the added docblocks? |
nicolas-grekas commentedJan 29, 2019
Thank you@renanbr. |
…rekas, Renan)This PR was merged into the 3.4 branch.Discussion----------[Security] don't do nested calls to serialize()| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#29951| License | MIT| Doc PR | n/aThe problem (originally reported as `Symfony\Component\Security\Core\Authentication\Token\AbstractToken` issue), may occur also in classes extending `Symfony\Component\Security\Core\Exception\AuthenticationException`Tasks:- [x] Skip native serializer (workaround itself)- [x] Token test- [x] Exception testCommits-------10256fc skip native serialize among child and parent serializable objects41000f1 [Security] dont do nested calls to serialize()
| ]); | ||
| returnserialize([parent::serialize(true),$this->messageKey,$this->messageData]); | ||
| return$this->doSerialize($serialized,\func_num_args() ?\func_get_arg(0) :null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Problem: double return!
(seeing the others changes, I guess the first line should be$serialized = [...];)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
thanks@guilliamxavier , see#30044
…icolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[Security\Guard] bump lowest version of security-core| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Forgotten in#30006 so that `PostAuthenticationGuardToken` can call `AbstractToken::doSerialize()`.Commits-------93cfd5b [Security\Guard] bump lowest version of security-core
Uh oh!
There was an error while loading.Please reload this page.
The problem (originally reported as
Symfony\Component\Security\Core\Authentication\Token\AbstractTokenissue), may occur also in classes extendingSymfony\Component\Security\Core\Exception\AuthenticationExceptionTasks: