{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/63412801","id":63412801,"diff_hunk":"@@ -50,9 +50,9 @@ User.find(session[:user_id])\n \n ### Session id\n \n-NOTE: _The session id is a 32 byte long MD5 hash value._\n+NOTE: _The session id is a 32-character random hex string._\n \n-A session id consists of the hash value of a random string. The random string is the current time, a random number between 0 and 1, the process id number of the Ruby interpreter (also basically a random number) and a constant string. Currently it is not feasible to brute-force Rails' session ids. To date MD5 is uncompromised, but there have been collisions, so it is theoretically possible to create another input text with the same hash value. But this has had no security impact to date.\n+The session id is generated using `SecureRandom.hex` which generates a random hex string using platform specific methods (such as openssl, /dev/urandom or win32) for generating cryptographically secure random numbers. Currently it is not feasible to brute-force Rails' session ids.","path":"guides/source/security.md","position":8,"original_position":8,"commit_id":"f27325d7e5cce3088c746ca91393b5fd95ee8552","original_commit_id":"f27325d7e5cce3088c746ca91393b5fd95ee8552","user":{"login":"vipulnsward","id":567626,"avatar_url":"https://avatars.githubusercontent.com/u/567626?v=3","gravatar_id":"","url":"https://api.github.com/users/vipulnsward","html_url":"https://github.com/vipulnsward","followers_url":"https://api.github.com/users/vipulnsward/followers","following_url":"https://api.github.com/users/vipulnsward/following{/other_user}","gists_url":"https://api.github.com/users/vipulnsward/gists{/gist_id}","starred_url":"https://api.github.com/users/vipulnsward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vipulnsward/subscriptions","organizations_url":"https://api.github.com/users/vipulnsward/orgs","repos_url":"https://api.github.com/users/vipulnsward/repos","events_url":"https://api.github.com/users/vipulnsward/events{/privacy}","received_events_url":"https://api.github.com/users/vipulnsward/received_events","type":"User","site_admin":false},"body":"Thanks, overall looks good. Can you point to source for this? \r\nI could not find it over at `SecureRandom.hex` ruby docs.","created_at":"2016-05-16T19:46:30Z","updated_at":"2016-05-16T19:46:30Z","html_url":"https://github.com/rails/rails/pull/25035#discussion_r63412801","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/25035","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/63412801"},"html":{"href":"https://github.com/rails/rails/pull/25035#discussion_r63412801"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/25035"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/25035","id":70246459,"html_url":"https://github.com/rails/rails/pull/25035","diff_url":"https://github.com/rails/rails/pull/25035.diff","patch_url":"https://github.com/rails/rails/pull/25035.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/25035","number":25035,"state":"open","locked":false,"title":"Update the Rails security guide","user":{"login":"ralinchimev","id":10473586,"avatar_url":"https://avatars.githubusercontent.com/u/10473586?v=3","gravatar_id":"","url":"https://api.github.com/users/ralinchimev","html_url":"https://github.com/ralinchimev","followers_url":"https://api.github.com/users/ralinchimev/followers","following_url":"https://api.github.com/users/ralinchimev/following{/other_user}","gists_url":"https://api.github.com/users/ralinchimev/gists{/gist_id}","starred_url":"https://api.github.com/users/ralinchimev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralinchimev/subscriptions","organizations_url":"https://api.github.com/users/ralinchimev/orgs","repos_url":"https://api.github.com/users/ralinchimev/repos","events_url":"https://api.github.com/users/ralinchimev/events{/privacy}","received_events_url":"https://api.github.com/users/ralinchimev/received_events","type":"User","site_admin":false},"body":"Bring up-to-date the information about the session id in the\r\nSessions section. The guide currently says that the session\r\nid is a md5 hash while the implementation uses a random hex\r\nstring.\r\n\r\nFixes #25032.\r\n\r\n[ci skip]","created_at":"2016-05-16T19:22:48Z","updated_at":"2016-05-16T19:46:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71f3a3c5ce8baf7ed1553f53fb31561d53e44698","assignee":{"login":"matthewd","id":1034,"avatar_url":"https://avatars.githubusercontent.com/u/1034?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewd","html_url":"https://github.com/matthewd","followers_url":"https://api.github.com/users/matthewd/followers","following_url":"https://api.github.com/users/matthewd/following{/other_user}","gists_url":"https://api.github.com/users/matthewd/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewd/subscriptions","organizations_url":"https://api.github.com/users/matthewd/orgs","repos_url":"https://api.github.com/users/matthewd/repos","events_url":"https://api.github.com/users/matthewd/events{/privacy}","received_events_url":"https://api.github.com/users/matthewd/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/25035/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/25035/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/25035/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/f27325d7e5cce3088c746ca91393b5fd95ee8552","head":{"label":"ralinchimev:update-security-guide","ref":"update-security-guide","sha":"f27325d7e5cce3088c746ca91393b5fd95ee8552","user":{"login":"ralinchimev","id":10473586,"avatar_url":"https://avatars.githubusercontent.com/u/10473586?v=3","gravatar_id":"","url":"https://api.github.com/users/ralinchimev","html_url":"https://github.com/ralinchimev","followers_url":"https://api.github.com/users/ralinchimev/followers","following_url":"https://api.github.com/users/ralinchimev/following{/other_user}","gists_url":"https://api.github.com/users/ralinchimev/gists{/gist_id}","starred_url":"https://api.github.com/users/ralinchimev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralinchimev/subscriptions","organizations_url":"https://api.github.com/users/ralinchimev/orgs","repos_url":"https://api.github.com/users/ralinchimev/repos","events_url":"https://api.github.com/users/ralinchimev/events{/privacy}","received_events_url":"https://api.github.com/users/ralinchimev/received_events","type":"User","site_admin":false},"repo":{"id":57279604,"name":"rails","full_name":"ralinchimev/rails","owner":{"login":"ralinchimev","id":10473586,"avatar_url":"https://avatars.githubusercontent.com/u/10473586?v=3","gravatar_id":"","url":"https://api.github.com/users/ralinchimev","html_url":"https://github.com/ralinchimev","followers_url":"https://api.github.com/users/ralinchimev/followers","following_url":"https://api.github.com/users/ralinchimev/following{/other_user}","gists_url":"https://api.github.com/users/ralinchimev/gists{/gist_id}","starred_url":"https://api.github.com/users/ralinchimev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralinchimev/subscriptions","organizations_url":"https://api.github.com/users/ralinchimev/orgs","repos_url":"https://api.github.com/users/ralinchimev/repos","events_url":"https://api.github.com/users/ralinchimev/events{/privacy}","received_events_url":"https://api.github.com/users/ralinchimev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ralinchimev/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/ralinchimev/rails","forks_url":"https://api.github.com/repos/ralinchimev/rails/forks","keys_url":"https://api.github.com/repos/ralinchimev/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ralinchimev/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ralinchimev/rails/teams","hooks_url":"https://api.github.com/repos/ralinchimev/rails/hooks","issue_events_url":"https://api.github.com/repos/ralinchimev/rails/issues/events{/number}","events_url":"https://api.github.com/repos/ralinchimev/rails/events","assignees_url":"https://api.github.com/repos/ralinchimev/rails/assignees{/user}","branches_url":"https://api.github.com/repos/ralinchimev/rails/branches{/branch}","tags_url":"https://api.github.com/repos/ralinchimev/rails/tags","blobs_url":"https://api.github.com/repos/ralinchimev/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ralinchimev/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ralinchimev/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/ralinchimev/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ralinchimev/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/ralinchimev/rails/languages","stargazers_url":"https://api.github.com/repos/ralinchimev/rails/stargazers","contributors_url":"https://api.github.com/repos/ralinchimev/rails/contributors","subscribers_url":"https://api.github.com/repos/ralinchimev/rails/subscribers","subscription_url":"https://api.github.com/repos/ralinchimev/rails/subscription","commits_url":"https://api.github.com/repos/ralinchimev/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/ralinchimev/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/ralinchimev/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/ralinchimev/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/ralinchimev/rails/contents/{+path}","compare_url":"https://api.github.com/repos/ralinchimev/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ralinchimev/rails/merges","archive_url":"https://api.github.com/repos/ralinchimev/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ralinchimev/rails/downloads","issues_url":"https://api.github.com/repos/ralinchimev/rails/issues{/number}","pulls_url":"https://api.github.com/repos/ralinchimev/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/ralinchimev/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/ralinchimev/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ralinchimev/rails/labels{/name}","releases_url":"https://api.github.com/repos/ralinchimev/rails/releases{/id}","deployments_url":"https://api.github.com/repos/ralinchimev/rails/deployments","created_at":"2016-04-28T07:16:38Z","updated_at":"2016-04-28T07:17:35Z","pushed_at":"2016-05-16T19:18:02Z","git_url":"git://github.com/ralinchimev/rails.git","ssh_url":"git@github.com:ralinchimev/rails.git","clone_url":"https://github.com/ralinchimev/rails.git","svn_url":"https://github.com/ralinchimev/rails","homepage":"http://rubyonrails.org","size":135549,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"8fffee4b1cd7f742edb267d72f4007d0ed4c594b","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2016-05-16T17:29:56Z","pushed_at":"2016-05-16T19:38:48Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":341023,"stargazers_count":31154,"watchers_count":31154,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12624,"mirror_url":null,"open_issues_count":978,"forks":12624,"open_issues":978,"watchers":31154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/25035"},"html":{"href":"https://github.com/rails/rails/pull/25035"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/25035"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/25035/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/25035/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/25035/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/f27325d7e5cce3088c746ca91393b5fd95ee8552"}}}}