{"action":"closed","number":832,"pull_request":{"url":"https://api.github.com/repos/websockets/ws/pulls/832","id":85993368,"html_url":"https://github.com/websockets/ws/pull/832","diff_url":"https://github.com/websockets/ws/pull/832.diff","patch_url":"https://github.com/websockets/ws/pull/832.patch","issue_url":"https://api.github.com/repos/websockets/ws/issues/832","number":832,"state":"closed","locked":false,"title":"Security: Use crypto.randomBytes, not Math.random","user":{"login":"coolaj86","id":122831,"avatar_url":"https://avatars.githubusercontent.com/u/122831?v=3","gravatar_id":"","url":"https://api.github.com/users/coolaj86","html_url":"https://github.com/coolaj86","followers_url":"https://api.github.com/users/coolaj86/followers","following_url":"https://api.github.com/users/coolaj86/following{/other_user}","gists_url":"https://api.github.com/users/coolaj86/gists{/gist_id}","starred_url":"https://api.github.com/users/coolaj86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolaj86/subscriptions","organizations_url":"https://api.github.com/users/coolaj86/orgs","repos_url":"https://api.github.com/users/coolaj86/repos","events_url":"https://api.github.com/users/coolaj86/events{/privacy}","received_events_url":"https://api.github.com/users/coolaj86/received_events","type":"User","site_admin":false},"body":"Depending on the JavaScript engine (node now runs on Chakra and V8) Math.random can be anywhere between [extremely insecure](https://medium.com/@betable/tifu-by-using-math-random-f1c308c4fd9d#.2h4wfgmoo) (v8's implementation has collisions at around 24,000 cycles) and cryptographically pseudo-random.\n\nHowever, using crypto.randomBytes() directly ensures that the secure version is always used.\n","created_at":"2016-09-20T15:00:07Z","updated_at":"2016-11-25T11:44:09Z","closed_at":"2016-11-25T11:44:09Z","merged_at":null,"merge_commit_sha":"49ba5d60c2e3ec84994502613dcd15cab5fea597","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/websockets/ws/pulls/832/commits","review_comments_url":"https://api.github.com/repos/websockets/ws/pulls/832/comments","review_comment_url":"https://api.github.com/repos/websockets/ws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/websockets/ws/issues/832/comments","statuses_url":"https://api.github.com/repos/websockets/ws/statuses/85deba067864bc0cc49dec005e1570db0f1fadae","head":{"label":"coolaj86:patch-3","ref":"patch-3","sha":"85deba067864bc0cc49dec005e1570db0f1fadae","user":{"login":"coolaj86","id":122831,"avatar_url":"https://avatars.githubusercontent.com/u/122831?v=3","gravatar_id":"","url":"https://api.github.com/users/coolaj86","html_url":"https://github.com/coolaj86","followers_url":"https://api.github.com/users/coolaj86/followers","following_url":"https://api.github.com/users/coolaj86/following{/other_user}","gists_url":"https://api.github.com/users/coolaj86/gists{/gist_id}","starred_url":"https://api.github.com/users/coolaj86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolaj86/subscriptions","organizations_url":"https://api.github.com/users/coolaj86/orgs","repos_url":"https://api.github.com/users/coolaj86/repos","events_url":"https://api.github.com/users/coolaj86/events{/privacy}","received_events_url":"https://api.github.com/users/coolaj86/received_events","type":"User","site_admin":false},"repo":{"id":22107327,"name":"ws","full_name":"coolaj86/ws","owner":{"login":"coolaj86","id":122831,"avatar_url":"https://avatars.githubusercontent.com/u/122831?v=3","gravatar_id":"","url":"https://api.github.com/users/coolaj86","html_url":"https://github.com/coolaj86","followers_url":"https://api.github.com/users/coolaj86/followers","following_url":"https://api.github.com/users/coolaj86/following{/other_user}","gists_url":"https://api.github.com/users/coolaj86/gists{/gist_id}","starred_url":"https://api.github.com/users/coolaj86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolaj86/subscriptions","organizations_url":"https://api.github.com/users/coolaj86/orgs","repos_url":"https://api.github.com/users/coolaj86/repos","events_url":"https://api.github.com/users/coolaj86/events{/privacy}","received_events_url":"https://api.github.com/users/coolaj86/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coolaj86/ws","description":"`ws`: The fastest RFC-6455 WebSocket implementation for Node.js.","fork":true,"url":"https://api.github.com/repos/coolaj86/ws","forks_url":"https://api.github.com/repos/coolaj86/ws/forks","keys_url":"https://api.github.com/repos/coolaj86/ws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coolaj86/ws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coolaj86/ws/teams","hooks_url":"https://api.github.com/repos/coolaj86/ws/hooks","issue_events_url":"https://api.github.com/repos/coolaj86/ws/issues/events{/number}","events_url":"https://api.github.com/repos/coolaj86/ws/events","assignees_url":"https://api.github.com/repos/coolaj86/ws/assignees{/user}","branches_url":"https://api.github.com/repos/coolaj86/ws/branches{/branch}","tags_url":"https://api.github.com/repos/coolaj86/ws/tags","blobs_url":"https://api.github.com/repos/coolaj86/ws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coolaj86/ws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coolaj86/ws/git/refs{/sha}","trees_url":"https://api.github.com/repos/coolaj86/ws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coolaj86/ws/statuses/{sha}","languages_url":"https://api.github.com/repos/coolaj86/ws/languages","stargazers_url":"https://api.github.com/repos/coolaj86/ws/stargazers","contributors_url":"https://api.github.com/repos/coolaj86/ws/contributors","subscribers_url":"https://api.github.com/repos/coolaj86/ws/subscribers","subscription_url":"https://api.github.com/repos/coolaj86/ws/subscription","commits_url":"https://api.github.com/repos/coolaj86/ws/commits{/sha}","git_commits_url":"https://api.github.com/repos/coolaj86/ws/git/commits{/sha}","comments_url":"https://api.github.com/repos/coolaj86/ws/comments{/number}","issue_comment_url":"https://api.github.com/repos/coolaj86/ws/issues/comments{/number}","contents_url":"https://api.github.com/repos/coolaj86/ws/contents/{+path}","compare_url":"https://api.github.com/repos/coolaj86/ws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coolaj86/ws/merges","archive_url":"https://api.github.com/repos/coolaj86/ws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coolaj86/ws/downloads","issues_url":"https://api.github.com/repos/coolaj86/ws/issues{/number}","pulls_url":"https://api.github.com/repos/coolaj86/ws/pulls{/number}","milestones_url":"https://api.github.com/repos/coolaj86/ws/milestones{/number}","notifications_url":"https://api.github.com/repos/coolaj86/ws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coolaj86/ws/labels{/name}","releases_url":"https://api.github.com/repos/coolaj86/ws/releases{/id}","deployments_url":"https://api.github.com/repos/coolaj86/ws/deployments","created_at":"2014-07-22T14:34:09Z","updated_at":"2014-07-22T07:01:18Z","pushed_at":"2016-09-20T14:59:58Z","git_url":"git://github.com/coolaj86/ws.git","ssh_url":"git@github.com:coolaj86/ws.git","clone_url":"https://github.com/coolaj86/ws.git","svn_url":"https://github.com/coolaj86/ws","homepage":"http://einaros.github.com/ws","size":2422,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"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":"websockets:master","ref":"master","sha":"3e1aa854dee6c1c4c9c1d820ff907356841949ce","user":{"login":"websockets","id":10721323,"avatar_url":"https://avatars.githubusercontent.com/u/10721323?v=3","gravatar_id":"","url":"https://api.github.com/users/websockets","html_url":"https://github.com/websockets","followers_url":"https://api.github.com/users/websockets/followers","following_url":"https://api.github.com/users/websockets/following{/other_user}","gists_url":"https://api.github.com/users/websockets/gists{/gist_id}","starred_url":"https://api.github.com/users/websockets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/websockets/subscriptions","organizations_url":"https://api.github.com/users/websockets/orgs","repos_url":"https://api.github.com/users/websockets/repos","events_url":"https://api.github.com/users/websockets/events{/privacy}","received_events_url":"https://api.github.com/users/websockets/received_events","type":"Organization","site_admin":false},"repo":{"id":2744972,"name":"ws","full_name":"websockets/ws","owner":{"login":"websockets","id":10721323,"avatar_url":"https://avatars.githubusercontent.com/u/10721323?v=3","gravatar_id":"","url":"https://api.github.com/users/websockets","html_url":"https://github.com/websockets","followers_url":"https://api.github.com/users/websockets/followers","following_url":"https://api.github.com/users/websockets/following{/other_user}","gists_url":"https://api.github.com/users/websockets/gists{/gist_id}","starred_url":"https://api.github.com/users/websockets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/websockets/subscriptions","organizations_url":"https://api.github.com/users/websockets/orgs","repos_url":"https://api.github.com/users/websockets/repos","events_url":"https://api.github.com/users/websockets/events{/privacy}","received_events_url":"https://api.github.com/users/websockets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/websockets/ws","description":"`ws`: The fastest cross platform RFC-6455 WebSocket implementation for Node.js.","fork":false,"url":"https://api.github.com/repos/websockets/ws","forks_url":"https://api.github.com/repos/websockets/ws/forks","keys_url":"https://api.github.com/repos/websockets/ws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/websockets/ws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/websockets/ws/teams","hooks_url":"https://api.github.com/repos/websockets/ws/hooks","issue_events_url":"https://api.github.com/repos/websockets/ws/issues/events{/number}","events_url":"https://api.github.com/repos/websockets/ws/events","assignees_url":"https://api.github.com/repos/websockets/ws/assignees{/user}","branches_url":"https://api.github.com/repos/websockets/ws/branches{/branch}","tags_url":"https://api.github.com/repos/websockets/ws/tags","blobs_url":"https://api.github.com/repos/websockets/ws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/websockets/ws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/websockets/ws/git/refs{/sha}","trees_url":"https://api.github.com/repos/websockets/ws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/websockets/ws/statuses/{sha}","languages_url":"https://api.github.com/repos/websockets/ws/languages","stargazers_url":"https://api.github.com/repos/websockets/ws/stargazers","contributors_url":"https://api.github.com/repos/websockets/ws/contributors","subscribers_url":"https://api.github.com/repos/websockets/ws/subscribers","subscription_url":"https://api.github.com/repos/websockets/ws/subscription","commits_url":"https://api.github.com/repos/websockets/ws/commits{/sha}","git_commits_url":"https://api.github.com/repos/websockets/ws/git/commits{/sha}","comments_url":"https://api.github.com/repos/websockets/ws/comments{/number}","issue_comment_url":"https://api.github.com/repos/websockets/ws/issues/comments{/number}","contents_url":"https://api.github.com/repos/websockets/ws/contents/{+path}","compare_url":"https://api.github.com/repos/websockets/ws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/websockets/ws/merges","archive_url":"https://api.github.com/repos/websockets/ws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/websockets/ws/downloads","issues_url":"https://api.github.com/repos/websockets/ws/issues{/number}","pulls_url":"https://api.github.com/repos/websockets/ws/pulls{/number}","milestones_url":"https://api.github.com/repos/websockets/ws/milestones{/number}","notifications_url":"https://api.github.com/repos/websockets/ws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/websockets/ws/labels{/name}","releases_url":"https://api.github.com/repos/websockets/ws/releases{/id}","deployments_url":"https://api.github.com/repos/websockets/ws/deployments","created_at":"2011-11-09T22:32:45Z","updated_at":"2016-11-25T10:27:50Z","pushed_at":"2016-11-25T11:43:19Z","git_url":"git://github.com/websockets/ws.git","ssh_url":"git@github.com:websockets/ws.git","clone_url":"https://github.com/websockets/ws.git","svn_url":"https://github.com/websockets/ws","homepage":"","size":3362,"stargazers_count":4268,"watchers_count":4268,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":728,"mirror_url":null,"open_issues_count":112,"forks":728,"open_issues":112,"watchers":4268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/websockets/ws/pulls/832"},"html":{"href":"https://github.com/websockets/ws/pull/832"},"issue":{"href":"https://api.github.com/repos/websockets/ws/issues/832"},"comments":{"href":"https://api.github.com/repos/websockets/ws/issues/832/comments"},"review_comments":{"href":"https://api.github.com/repos/websockets/ws/pulls/832/comments"},"review_comment":{"href":"https://api.github.com/repos/websockets/ws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/websockets/ws/pulls/832/commits"},"statuses":{"href":"https://api.github.com/repos/websockets/ws/statuses/85deba067864bc0cc49dec005e1570db0f1fadae"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":19,"review_comments":0,"commits":1,"additions":1,"deletions":6,"changed_files":1}}
{"actor":{"display_login":"lpinca"}}