Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Security] Store original token in token storage when implicitly exiting impersonation#58754

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

Merged

Conversation

@wouterj
Copy link
Member

@wouterjwouterj commentedNov 4, 2024
edited
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Issues-
LicenseMIT

If you impersonate user A and then start impersonation for user B, Symfony explicitly exits the first impersonation before starting the second one. However, we did not update the token in the token storage at this moment.

This creates issues when using a custom voterlike the one documented, as this usesSecurity::isGranted(), which relies on the token in the token storage. So instead of checking if the original user can impersonate, it will check if user A can impersonate.

@fabpot
Copy link
Member

Thank you@wouterj.

@fabpotfabpot merged commitc905bb4 intosymfony:5.4Nov 4, 2024
11 of 12 checks passed
@wouterjwouterj deleted the security-implicit-impersonation branchNovember 4, 2024 12:51
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestNov 19, 2024
…token to vote on (xabbuh)This PR was merged into the 5.4 branch.Discussion----------[Security] use access decision manager to control which token to vote onFollowingsymfony/symfony#58754: calling. `Security::isGranted()` inside a voter has the drawback that we do not know if the checks performed here act on the same token that we have in our voter as the token inside the token storage might have change or may change in between.Commits-------fc0030a use access decision manager to control which token to vote on
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

5 participants

@wouterj@fabpot@xabbuh@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp