{"action":"opened","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/20071","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/20071/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/20071/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/20071/events","html_url":"https://github.com/symfony/symfony/issues/20071","id":179807547,"number":20071,"title":"Warn developers when they use unsafe hashers/encoders","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Security","name":"Security","color":"DDDDDD"},{"url":"https://api.github.com/repos/symfony/symfony/labels/SecurityBundle","name":"SecurityBundle","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-28T15:32:56Z","updated_at":"2016-09-28T15:32:56Z","closed_at":null,"body":"Somewhat related to #20045 discussion, we could warn developers when they use unsafe encoder types. I'm thinking about something like this:\r\n\r\n```php\r\nif (null !== $this->logger && 'plaintext' === $encoderType) {\r\n    $this->logger->warning('Storing user passwords in plain text is considered a critical security error. Consider configuring a password encoder for the \"%s\" entity.');\r\n}\r\n\r\nif (null !== $this->logger && in_array($encoderType, array('sha512', 'sha384', 'sha256', 'sha1', 'md5'))) {\r\n    $this->logger->warning('Hashing user passwords with \"%s\" algorithm is considered a bad security practice. Consider using \"bcrypt\" as the password encoder for the \"%s\" entity.');\r\n}\r\n```\r\n\r\nIf you like this idea, how and where could we log those warning messages? Thanks!\r\n\r\n"}}
{"actor":{"display_login":"javiereguiluz"}}