{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/44595470","id":44595470,"diff_hunk":"@@ -77,6 +77,10 @@ module RequestForgeryProtection\n       config_accessor :log_warning_on_csrf_failure\n       self.log_warning_on_csrf_failure = true\n \n+      # Controls whether the Origin header is checked in addition to the CSRF token.\n+      config_accessor :forgery_protection_origin_check\n+      self.forgery_protection_origin_check = false\n+","path":"actionpack/lib/action_controller/metal/request_forgery_protection.rb","position":7,"original_position":7,"commit_id":"65f3709186b90b8fed7fbbb449bab39bd5ccd549","original_commit_id":"65f3709186b90b8fed7fbbb449bab39bd5ccd549","user":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"body":"Yeah, it would also break apps that might run on multiple domains and POST between them. I'll defer to you folks' judgement on whether it should be enabled by default.","created_at":"2015-11-11T22:20:41Z","updated_at":"2015-11-11T22:20:41Z","html_url":"https://github.com/rails/rails/pull/22263#discussion_r44595470","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/22263","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/44595470"},"html":{"href":"https://github.com/rails/rails/pull/22263#discussion_r44595470"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/22263"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/22263","id":50404437,"html_url":"https://github.com/rails/rails/pull/22263","diff_url":"https://github.com/rails/rails/pull/22263.diff","patch_url":"https://github.com/rails/rails/pull/22263.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/22263","number":22263,"state":"open","locked":false,"title":"Add option to verify Origin header in CSRF checks","user":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"body":"We're trying to upstream some of the CSRF improvements we've made at GitHub. This first one is pretty simple. It checks the `Origin` header, if present, against `request.base_url` during the CSRF checks. This isn't *fixing* any existing problem, but adds another layer of defense to the Rails CSRF mitigations.\r\n\r\n/cc @oreoshake @ptoomey3","created_at":"2015-11-11T16:35:05Z","updated_at":"2015-11-11T22:20:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2deb3626619b8dbac5b4e1869f4f5a759b7f23c4","assignee":{"login":"jeremy","id":199,"avatar_url":"https://avatars.githubusercontent.com/u/199?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremy","html_url":"https://github.com/jeremy","followers_url":"https://api.github.com/users/jeremy/followers","following_url":"https://api.github.com/users/jeremy/following{/other_user}","gists_url":"https://api.github.com/users/jeremy/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremy/subscriptions","organizations_url":"https://api.github.com/users/jeremy/orgs","repos_url":"https://api.github.com/users/jeremy/repos","events_url":"https://api.github.com/users/jeremy/events{/privacy}","received_events_url":"https://api.github.com/users/jeremy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/22263/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/22263/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/22263/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/65f3709186b90b8fed7fbbb449bab39bd5ccd549","head":{"label":"mastahyeti:csrf-origin-check","ref":"csrf-origin-check","sha":"65f3709186b90b8fed7fbbb449bab39bd5ccd549","user":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"repo":{"id":45993621,"name":"rails","full_name":"mastahyeti/rails","owner":{"login":"mastahyeti","id":1144197,"avatar_url":"https://avatars.githubusercontent.com/u/1144197?v=3","gravatar_id":"","url":"https://api.github.com/users/mastahyeti","html_url":"https://github.com/mastahyeti","followers_url":"https://api.github.com/users/mastahyeti/followers","following_url":"https://api.github.com/users/mastahyeti/following{/other_user}","gists_url":"https://api.github.com/users/mastahyeti/gists{/gist_id}","starred_url":"https://api.github.com/users/mastahyeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastahyeti/subscriptions","organizations_url":"https://api.github.com/users/mastahyeti/orgs","repos_url":"https://api.github.com/users/mastahyeti/repos","events_url":"https://api.github.com/users/mastahyeti/events{/privacy}","received_events_url":"https://api.github.com/users/mastahyeti/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/mastahyeti/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/mastahyeti/rails","forks_url":"https://api.github.com/repos/mastahyeti/rails/forks","keys_url":"https://api.github.com/repos/mastahyeti/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mastahyeti/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mastahyeti/rails/teams","hooks_url":"https://api.github.com/repos/mastahyeti/rails/hooks","issue_events_url":"https://api.github.com/repos/mastahyeti/rails/issues/events{/number}","events_url":"https://api.github.com/repos/mastahyeti/rails/events","assignees_url":"https://api.github.com/repos/mastahyeti/rails/assignees{/user}","branches_url":"https://api.github.com/repos/mastahyeti/rails/branches{/branch}","tags_url":"https://api.github.com/repos/mastahyeti/rails/tags","blobs_url":"https://api.github.com/repos/mastahyeti/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mastahyeti/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mastahyeti/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/mastahyeti/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mastahyeti/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/mastahyeti/rails/languages","stargazers_url":"https://api.github.com/repos/mastahyeti/rails/stargazers","contributors_url":"https://api.github.com/repos/mastahyeti/rails/contributors","subscribers_url":"https://api.github.com/repos/mastahyeti/rails/subscribers","subscription_url":"https://api.github.com/repos/mastahyeti/rails/subscription","commits_url":"https://api.github.com/repos/mastahyeti/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/mastahyeti/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/mastahyeti/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/mastahyeti/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/mastahyeti/rails/contents/{+path}","compare_url":"https://api.github.com/repos/mastahyeti/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mastahyeti/rails/merges","archive_url":"https://api.github.com/repos/mastahyeti/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mastahyeti/rails/downloads","issues_url":"https://api.github.com/repos/mastahyeti/rails/issues{/number}","pulls_url":"https://api.github.com/repos/mastahyeti/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/mastahyeti/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/mastahyeti/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mastahyeti/rails/labels{/name}","releases_url":"https://api.github.com/repos/mastahyeti/rails/releases{/id}","created_at":"2015-11-11T16:29:28Z","updated_at":"2015-11-11T16:30:04Z","pushed_at":"2015-11-11T16:38:05Z","git_url":"git://github.com/mastahyeti/rails.git","ssh_url":"git@github.com:mastahyeti/rails.git","clone_url":"https://github.com/mastahyeti/rails.git","svn_url":"https://github.com/mastahyeti/rails","homepage":"http://rubyonrails.org","size":619328,"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":"f94e9a69b09fe63ba722a8e1815d0bd1f3daf3a6","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}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-11-11T22:10:25Z","pushed_at":"2015-11-11T22:09:04Z","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":619328,"stargazers_count":28354,"watchers_count":28354,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11452,"mirror_url":null,"open_issues_count":841,"forks":11452,"open_issues":841,"watchers":28354,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/22263"},"html":{"href":"https://github.com/rails/rails/pull/22263"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/22263"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/22263/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/22263/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/22263/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/65f3709186b90b8fed7fbbb449bab39bd5ccd549"}}}}