{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/screenshots/pulls/comments/229421322","pull_request_review_id":169919145,"id":229421322,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTQyMTMyMg==","diff_hunk":"@@ -1091,16 +1091,22 @@ app.get(\"/api/fxa-oauth/login/*\", async function(req, res, next) {\n   try {\n     const stateBytes = await randomBytes(32);\n     let state = stateBytes.toString(\"hex\");\n-    let stateId = null;\n \n-    if (req.deviceId) {\n+    const cookies = new Cookies(req, res, {keys: dbschema.getKeygrip(\"fxa-oauth\")});\n+    let stateId = cookies.get(\"fxaState\");\n+    if (stateId && (stateId.search(/^[a-zA-Z0-9_-]{1,255}$/) === -1)) {","path":"server/src/server.js","position":9,"original_position":9,"commit_id":"222a206864bc7e744df85c006d0a2a182fcacf67","original_commit_id":"222a206864bc7e744df85c006d0a2a182fcacf67","user":{"login":"6a68","id":96396,"node_id":"MDQ6VXNlcjk2Mzk2","avatar_url":"https://avatars3.githubusercontent.com/u/96396?v=4","gravatar_id":"","url":"https://api.github.com/users/6a68","html_url":"https://github.com/6a68","followers_url":"https://api.github.com/users/6a68/followers","following_url":"https://api.github.com/users/6a68/following{/other_user}","gists_url":"https://api.github.com/users/6a68/gists{/gist_id}","starred_url":"https://api.github.com/users/6a68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/6a68/subscriptions","organizations_url":"https://api.github.com/users/6a68/orgs","repos_url":"https://api.github.com/users/6a68/repos","events_url":"https://api.github.com/users/6a68/events{/privacy}","received_events_url":"https://api.github.com/users/6a68/received_events","type":"User","site_admin":false},"body":"@punamdahiya I'm not sure this is the right regexp to verify a UUID is well-formed","created_at":"2018-10-30T17:59:54Z","updated_at":"2018-10-30T17:59:55Z","html_url":"https://github.com/mozilla-services/screenshots/pull/5104#discussion_r229421322","pull_request_url":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/screenshots/pulls/comments/229421322"},"html":{"href":"https://github.com/mozilla-services/screenshots/pull/5104#discussion_r229421322"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104"}},"in_reply_to_id":229418032},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104","id":226693724,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NjkzNzI0","html_url":"https://github.com/mozilla-services/screenshots/pull/5104","diff_url":"https://github.com/mozilla-services/screenshots/pull/5104.diff","patch_url":"https://github.com/mozilla-services/screenshots/pull/5104.patch","issue_url":"https://api.github.com/repos/mozilla-services/screenshots/issues/5104","number":5104,"state":"open","locked":false,"title":"Fixes #5102 - Bad Oauth State with FxA login","user":{"login":"punamdahiya","id":597734,"node_id":"MDQ6VXNlcjU5NzczNA==","avatar_url":"https://avatars1.githubusercontent.com/u/597734?v=4","gravatar_id":"","url":"https://api.github.com/users/punamdahiya","html_url":"https://github.com/punamdahiya","followers_url":"https://api.github.com/users/punamdahiya/followers","following_url":"https://api.github.com/users/punamdahiya/following{/other_user}","gists_url":"https://api.github.com/users/punamdahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/punamdahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punamdahiya/subscriptions","organizations_url":"https://api.github.com/users/punamdahiya/orgs","repos_url":"https://api.github.com/users/punamdahiya/repos","events_url":"https://api.github.com/users/punamdahiya/events{/privacy}","received_events_url":"https://api.github.com/users/punamdahiya/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-29T19:58:13Z","updated_at":"2018-10-30T17:59:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c88c43c7a49618bef75fb70cd5f744b4b18c59c6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/screenshots/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/screenshots/issues/5104/comments","statuses_url":"https://api.github.com/repos/mozilla-services/screenshots/statuses/222a206864bc7e744df85c006d0a2a182fcacf67","head":{"label":"punamdahiya:5102_bad_oauth","ref":"5102_bad_oauth","sha":"222a206864bc7e744df85c006d0a2a182fcacf67","user":{"login":"punamdahiya","id":597734,"node_id":"MDQ6VXNlcjU5NzczNA==","avatar_url":"https://avatars1.githubusercontent.com/u/597734?v=4","gravatar_id":"","url":"https://api.github.com/users/punamdahiya","html_url":"https://github.com/punamdahiya","followers_url":"https://api.github.com/users/punamdahiya/followers","following_url":"https://api.github.com/users/punamdahiya/following{/other_user}","gists_url":"https://api.github.com/users/punamdahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/punamdahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punamdahiya/subscriptions","organizations_url":"https://api.github.com/users/punamdahiya/orgs","repos_url":"https://api.github.com/users/punamdahiya/repos","events_url":"https://api.github.com/users/punamdahiya/events{/privacy}","received_events_url":"https://api.github.com/users/punamdahiya/received_events","type":"User","site_admin":false},"repo":{"id":126058573,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYwNTg1NzM=","name":"screenshots","full_name":"punamdahiya/screenshots","private":false,"owner":{"login":"punamdahiya","id":597734,"node_id":"MDQ6VXNlcjU5NzczNA==","avatar_url":"https://avatars1.githubusercontent.com/u/597734?v=4","gravatar_id":"","url":"https://api.github.com/users/punamdahiya","html_url":"https://github.com/punamdahiya","followers_url":"https://api.github.com/users/punamdahiya/followers","following_url":"https://api.github.com/users/punamdahiya/following{/other_user}","gists_url":"https://api.github.com/users/punamdahiya/gists{/gist_id}","starred_url":"https://api.github.com/users/punamdahiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punamdahiya/subscriptions","organizations_url":"https://api.github.com/users/punamdahiya/orgs","repos_url":"https://api.github.com/users/punamdahiya/repos","events_url":"https://api.github.com/users/punamdahiya/events{/privacy}","received_events_url":"https://api.github.com/users/punamdahiya/received_events","type":"User","site_admin":false},"html_url":"https://github.com/punamdahiya/screenshots","description":"Firefox Screenshots: the best way to take screenshots on the web.","fork":true,"url":"https://api.github.com/repos/punamdahiya/screenshots","forks_url":"https://api.github.com/repos/punamdahiya/screenshots/forks","keys_url":"https://api.github.com/repos/punamdahiya/screenshots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/punamdahiya/screenshots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/punamdahiya/screenshots/teams","hooks_url":"https://api.github.com/repos/punamdahiya/screenshots/hooks","issue_events_url":"https://api.github.com/repos/punamdahiya/screenshots/issues/events{/number}","events_url":"https://api.github.com/repos/punamdahiya/screenshots/events","assignees_url":"https://api.github.com/repos/punamdahiya/screenshots/assignees{/user}","branches_url":"https://api.github.com/repos/punamdahiya/screenshots/branches{/branch}","tags_url":"https://api.github.com/repos/punamdahiya/screenshots/tags","blobs_url":"https://api.github.com/repos/punamdahiya/screenshots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/punamdahiya/screenshots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/punamdahiya/screenshots/git/refs{/sha}","trees_url":"https://api.github.com/repos/punamdahiya/screenshots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/punamdahiya/screenshots/statuses/{sha}","languages_url":"https://api.github.com/repos/punamdahiya/screenshots/languages","stargazers_url":"https://api.github.com/repos/punamdahiya/screenshots/stargazers","contributors_url":"https://api.github.com/repos/punamdahiya/screenshots/contributors","subscribers_url":"https://api.github.com/repos/punamdahiya/screenshots/subscribers","subscription_url":"https://api.github.com/repos/punamdahiya/screenshots/subscription","commits_url":"https://api.github.com/repos/punamdahiya/screenshots/commits{/sha}","git_commits_url":"https://api.github.com/repos/punamdahiya/screenshots/git/commits{/sha}","comments_url":"https://api.github.com/repos/punamdahiya/screenshots/comments{/number}","issue_comment_url":"https://api.github.com/repos/punamdahiya/screenshots/issues/comments{/number}","contents_url":"https://api.github.com/repos/punamdahiya/screenshots/contents/{+path}","compare_url":"https://api.github.com/repos/punamdahiya/screenshots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/punamdahiya/screenshots/merges","archive_url":"https://api.github.com/repos/punamdahiya/screenshots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/punamdahiya/screenshots/downloads","issues_url":"https://api.github.com/repos/punamdahiya/screenshots/issues{/number}","pulls_url":"https://api.github.com/repos/punamdahiya/screenshots/pulls{/number}","milestones_url":"https://api.github.com/repos/punamdahiya/screenshots/milestones{/number}","notifications_url":"https://api.github.com/repos/punamdahiya/screenshots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/punamdahiya/screenshots/labels{/name}","releases_url":"https://api.github.com/repos/punamdahiya/screenshots/releases{/id}","deployments_url":"https://api.github.com/repos/punamdahiya/screenshots/deployments","created_at":"2018-03-20T17:40:46Z","updated_at":"2018-03-20T17:40:50Z","pushed_at":"2018-10-29T19:57:49Z","git_url":"git://github.com/punamdahiya/screenshots.git","ssh_url":"git@github.com:punamdahiya/screenshots.git","clone_url":"https://github.com/punamdahiya/screenshots.git","svn_url":"https://github.com/punamdahiya/screenshots","homepage":"https://screenshots.firefox.com","size":18627,"stargazers_count":0,"watchers_count":0,"language":"FreeMarker","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"bbeb53a7cbd77ad48ccb635011a7b2981d1d6cc8","user":{"login":"mozilla-services","id":1066228,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjYyMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1066228?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":26788257,"node_id":"MDEwOlJlcG9zaXRvcnkyNjc4ODI1Nw==","name":"screenshots","full_name":"mozilla-services/screenshots","private":false,"owner":{"login":"mozilla-services","id":1066228,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjYyMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1066228?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mozilla-services/screenshots","description":"Firefox Screenshots: the best way to take screenshots on the web.","fork":false,"url":"https://api.github.com/repos/mozilla-services/screenshots","forks_url":"https://api.github.com/repos/mozilla-services/screenshots/forks","keys_url":"https://api.github.com/repos/mozilla-services/screenshots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/screenshots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/screenshots/teams","hooks_url":"https://api.github.com/repos/mozilla-services/screenshots/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/screenshots/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/screenshots/events","assignees_url":"https://api.github.com/repos/mozilla-services/screenshots/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/screenshots/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/screenshots/tags","blobs_url":"https://api.github.com/repos/mozilla-services/screenshots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/screenshots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/screenshots/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/screenshots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/screenshots/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/screenshots/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/screenshots/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/screenshots/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/screenshots/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/screenshots/subscription","commits_url":"https://api.github.com/repos/mozilla-services/screenshots/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/screenshots/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/screenshots/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/screenshots/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/screenshots/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/screenshots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/screenshots/merges","archive_url":"https://api.github.com/repos/mozilla-services/screenshots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/screenshots/downloads","issues_url":"https://api.github.com/repos/mozilla-services/screenshots/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/screenshots/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/screenshots/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/screenshots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/screenshots/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/screenshots/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-services/screenshots/deployments","created_at":"2014-11-18T02:28:36Z","updated_at":"2018-10-30T17:37:05Z","pushed_at":"2018-10-30T17:58:47Z","git_url":"git://github.com/mozilla-services/screenshots.git","ssh_url":"git@github.com:mozilla-services/screenshots.git","clone_url":"https://github.com/mozilla-services/screenshots.git","svn_url":"https://github.com/mozilla-services/screenshots","homepage":"https://screenshots.firefox.com","size":18817,"stargazers_count":495,"watchers_count":495,"language":"FreeMarker","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":127,"mirror_url":null,"archived":false,"open_issues_count":339,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":127,"open_issues":339,"watchers":495,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104"},"html":{"href":"https://github.com/mozilla-services/screenshots/pull/5104"},"issue":{"href":"https://api.github.com/repos/mozilla-services/screenshots/issues/5104"},"comments":{"href":"https://api.github.com/repos/mozilla-services/screenshots/issues/5104/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/screenshots/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/screenshots/pulls/5104/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/screenshots/statuses/222a206864bc7e744df85c006d0a2a182fcacf67"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"6a68"}}