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] Handle bad request format in json auth listener#22569

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
fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/3.3/security/json_login_bad_format_ex
Apr 29, 2017
Merged

[Security] Handle bad request format in json auth listener#22569

fabpot merged 1 commit intosymfony:masterfromogizanagi:feature/3.3/security/json_login_bad_format_ex
Apr 29, 2017

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedApr 28, 2017
edited
Loading

QA
Branch?master (3.3)
Bug fix?yesish
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

In#22034, I wondered myself if we shouldn't throw a dedicated exception to handle bad formatted requests and give more inputs to the client by returning a 400 response with an explicit message.

Here is a suggestion, introducing a newBadRequestFormatException and using it inUsernamePasswordJsonAuthenticationListener whenever there is no custom failure handler set (but someone using its own handler should be able to treat the failure properly too).

As discussed with@chalasr , it seems better to directly throw aBadRequestHttpException as it's actually out of the whole security process. PR updated.

chalasr, ro0NL, and yceruto reacted with thumbs up emoji
Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍 These exceptions are not about a failed authentication but a wrongly formatted request (and don't provide any sensitive info) thus should not trigger the authentication failure handler nor any authentication exception to be thrown.

@dunglas
Copy link
Member

Fair enough 👍

@nicolas-grekasnicolas-grekas added this to the3.3 milestoneApr 28, 2017
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commit93a8cb9 intosymfony:masterApr 29, 2017
fabpot added a commit that referenced this pull requestApr 29, 2017
… (ogizanagi)This PR was merged into the 3.3-dev branch.Discussion----------[Security] Handle bad request format in json auth listener| Q             | A| ------------- | ---| Branch?       | master (3.3)| Bug fix?      | yesish| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/AIn#22034, I wondered myself if we shouldn't throw a dedicated exception to handle bad formatted requests and give more inputs to the client by returning a 400 response with an explicit message.~~Here is a suggestion, introducing a new `BadRequestFormatException` and using it in `UsernamePasswordJsonAuthenticationListener` whenever there is no custom failure handler set (but someone using its own handler should be able to treat the failure properly too).~~As discussed with@chalasr , it seems better to directly throw a `BadRequestHttpException` as it's actually out of the whole security process. PR updated.Commits-------93a8cb9 [Security] Handle bad request format in json auth listener
@ogizanagiogizanagi deleted the feature/3.3/security/json_login_bad_format_ex branchApril 29, 2017 16:01
@nicolas-grekas
Copy link
Member

@ogizanagi master is red after this PR has been merged, would you mind looking at it please (or anyone else really?)

@chalasrchalasr mentioned this pull requestApr 29, 2017
@ogizanagi
Copy link
ContributorAuthor

ogizanagi commentedApr 29, 2017
edited
Loading

Sure. I'm on it. Too late,@chalasr did.

@chalasr
Copy link
Member

See#22582

nicolas-grekas added a commit that referenced this pull requestApr 29, 2017
This PR was merged into the 3.3-dev branch.Discussion----------Fix tests| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? |  no| Tests pass?   | yes| Fixed tickets |#22569 (comment)| License       | MIT| Doc PR        | n/aCommits-------b6948dd Fix tests
fabpot added a commit that referenced this pull requestJan 16, 2018
This PR was merged into the 2.7 branch.Discussion----------[Security] Fix fatal error on non string username| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#25612| License       | MIT| Doc PR        | n/aThat's consistent with what#22569 did for the `json_login` listener.Commits-------8f09568 [Security] Fix fatal error on non string username
@chalasrchalasr mentioned this pull requestJun 1, 2022
8 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

6 participants

@ogizanagi@dunglas@fabpot@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp