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

[Cookbook][Security] don't output message from AuthenticationException#4761

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
weaverryan merged 1 commit intosymfony:2.3fromxabbuh:replace-get-message
Jan 16, 2015

Conversation

xabbuh
Copy link
Member

QA
Doc fix?yes
New docs?no
Applies toall
Fixed tickets

Displaying the message of anAuthenticationException might expose
sensitive data to the user.

@xabbuh
Copy link
MemberAuthor

@stof I assumed you meant thegetMessageData() methodhere.getMessageParameters() does not exist.

@xabbuh
Copy link
MemberAuthor

ping@weaverryan@wouterj I think this is something we should merge as soon as possible to avoid giving insecure advices.

@weaverryan
Copy link
Member

Thanks@xabbuh. I'm actually not familiar with this - I knew this approach could leak info, but had the approach you suggested always worked, or is it new? Where did the idea come from? Forgive my lack of knowledge here :)

@xabbuh
Copy link
MemberAuthor

@stof made the suggestion in#4723 (comment). These methods are present in Symfony 2.3 too:http://api.symfony.com/2.3/Symfony/Component/Security/Core/Exception/AuthenticationException.html

@stof
Copy link
Member

@weaverryan this is a feature added in Symfony 2.2

@stof
Copy link
Member

@xabbuh indeed, I made a mistake when giving the method name (I haven't checked the code or the api doc when commenting)

@xabbuh
Copy link
MemberAuthor

@stof No problem, was not hard to guess the right method name. ;)

// ADD THIS use STATEMENT above your class
use Symfony\Component\Security\Core\SecurityContextInterface;

public function loginAction(Request $request)
{
$session = $request->getSession();
$error = null;
Copy link
Member

Choose a reason for hiding this comment

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

I think having this in the else is more clear

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Good suggestion, this might not be the way it would usually be done in the Symfony core, but it's actually more readable. Changed it.

Displaying the message of an `AuthenticationException` might exposesensitive data to the user.
@weaverryan
Copy link
Member

Thanks guys! I can't believe I had missed this. I used it recently in Silex in a KnpU tutorial, without even realizing how it fits into Symfony. I'm very happy to have this improved!

@weaverryanweaverryan merged commit44277c7 intosymfony:2.3Jan 16, 2015
weaverryan added a commit that referenced this pull requestJan 16, 2015
…cationException (xabbuh)This PR was merged into the 2.3 branch.Discussion----------[Cookbook][Security] don't output message from AuthenticationException| Q             | A| ------------- | ---| Doc fix?      | yes| New docs?     | no| Applies to    | all| Fixed tickets |Displaying the message of an `AuthenticationException` might exposesensitive data to the user.Commits-------44277c7 don't output message from AuthenticationException
@xabbuhxabbuh deleted the replace-get-message branchJanuary 16, 2015 21:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@xabbuh@weaverryan@stof@wouterj

[8]ページ先頭

©2009-2025 Movatter.jp