{"id":7383,"date":"2019-11-24T10:55:36","date_gmt":"2019-11-24T01:55:36","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=7383"},"modified":"2023-05-27T22:59:52","modified_gmt":"2023-05-27T13:59:52","slug":"%e3%80%90%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%80%91csrf%e3%82%af%e3%83%ad%e3%82%b9%e3%82%b5%e3%82%a4%e3%83%88%e3%83%aa%e3%82%af%e3%82%a8%e3%82%b9%e3%83%88%e3%83%95%e3%82%a9","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=7383","title":{"rendered":"\u3010\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3011CSRF(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u30d5\u30a9\u30fc\u30b8\u30a7\u30ea\uff09\u3068\u306f\uff1f"},"content":{"rendered":"<h2>CSRF(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u30d5\u30a9\u30fc\u30b8\u30a7\u30ea\uff09\u3068\u306f\uff1f<\/h2>\n<p>Web\u30a2\u30d7\u30ea\u304c\u6301\u3064\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u3057\u3066\u3001<span style=\"color: #ff0000;\"><strong>\u610f\u56f3\u3057\u306a\u3044\u5f62\u3067<\/strong><strong>\u5225\u306eWeb\u30a2\u30d7\u30ea\u304b\u3089\u610f\u56f3\u3057\u306a\u3044\u30c7\u30fc\u30bf\u3092\u5143\u306eWeb\u30a2\u30d7\u30ea\u306e\u30d5\u30a9\u30fc\u30e0\u306b\u9001\u4fe1\u3059\u308b\u653b\u6483\u624b\u6cd5\uff08\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u507d\u9020\uff09<\/strong><\/span>\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>\u653b\u6483\u306e\u304d\u3063\u304b\u3051\u3084\u4ed5\u7d44\u307f<\/h3>\n<p>\u653b\u6483\u5bfe\u8c61\u306eWeb\u30b5\u30a4\u30c8\u3092\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u307e\u307e\u306e\u72b6\u614b\u3067\u3001\u653b\u6483\u306f\u5225\u306eWeb\u30b5\u30a4\u30c8\u306b\u7528\u610f\u3057\u305f\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u30ea\u30f3\u30af\u3092\u8e0f\u3093\u3060\u308a\u753b\u50cf\u3092\u8868\u793a\u3057\u305f\u3053\u3068\u3092\u304d\u3063\u304b\u3051\u306b\u3057\u307e\u3059\u3002\u5229\u7528\u3057\u3066\u3044\u308b\u30a2\u30d7\u30ea\u3092\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u72b6\u614b\u3067\u3042\u308c\u3070Cookie\u60c5\u5831\u304c\u3067\u304d\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u5225\u30b5\u30a4\u30c8\u306b\u3066\u305d\u306e\u30ed\u30b0\u30a4\u30f3\u4e2d\u306eCookie\u60c5\u5831\u3092\u5229\u7528\u3057\u3066\u5143\u306e\u30a2\u30d7\u30ea\u3078\u4e0d\u6b63\u306a\u60aa\u610f\u306e\u3042\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p>\u4f8b\u3048\u3070\u3001SNS\u3084\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30d0\u30f3\u30ad\u30f3\u30b0\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u72b6\u614b\u3067\u3001\u4ed6\u306e\u60aa\u610f\u306e\u3042\u308b\u30b5\u30a4\u30c8\u306eURL\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u969b\u306b\u60c5\u5831\u53d6\u5f97\u3055\u308c\u305f\u308a\u3001\u52dd\u624b\u306b\u60aa\u610f\u306e\u3042\u308b\u60c5\u5831\u3092\u767a\u4fe1\u3055\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u306a\u308a\u3059\u307e\u3057\u3067\u77e5\u4eba\u3084\u53cb\u4eba\u306b\u5bfe\u3057\u3066\u60aa\u610f\u306e\u3042\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5e83\u3081\u3066\u3057\u307e\u3063\u305f\u308a\u3001\u30cd\u30c3\u30c8\u30d0\u30f3\u30af\u306e\u4e0d\u6b63\u64cd\u4f5c\u3092\u3055\u308c\u3066\u3057\u307e\u3063\u305f\u308a\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>Ruby on Rails\u306b\u304a\u3051\u308bCSRF\u5bfe\u7b56<\/h2>\n<p>Rails\u306f\u4e88\u3081form_with\u30d8\u30eb\u30d1\u30fc\u30e1\u30bd\u30c3\u30c9\u3067\u751f\u6210\u3057\u305f\u30d5\u30a9\u30fc\u30e0\u306e\u96a0\u3057\u8981\u7d20\u3068\u3057\u3066<span style=\"color: #ff0000;\"><strong>\u8a8d\u8a3c\u7528\u306e\u30c8\u30fc\u30af\u30f3\u3092Rails\u30a2\u30d7\u30ea\u304c\u8d77\u52d5\u3059\u308b\u30b5\u30fc\u30d0\u4e0a\u3067value\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/strong><\/span>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u9001\u4fe1\u3055\u308c\u305f\u5024\u304cvalue\u306e\u5024\u3068\u4e00\u81f4\u3059\u308b\u304b\u7167\u5408\u3057\u3066\u4e00\u81f4\u3057\u3066\u3044\u305f\u5834\u5408\u306b\u6b63\u3057\u3044\u30a2\u30af\u30bb\u30b9\u3068\u307f\u306a\u3057\u3001\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u60c5\u5831\u3092\u5143\u306b\u767b\u9332\u66f4\u65b0\u51e6\u7406\u7b49\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h3>\u5b9f\u969b\u306b\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u30bd\u30fc\u30b9(form_with\u30d8\u30eb\u30d1\u30fc\uff09<\/h3>\n<p>\u5177\u4f53\u7684\u306b\u306f\u3001Rails\u3067\u306f\u30d5\u30a9\u30fc\u30e0\u306e\u30bd\u30fc\u30b9\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u8a8d\u8a3c\u7528\u30c8\u30fc\u30af\u30f3\u306evalue\u304c\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u307e\u3059\u3002\uff09<\/p>\n<pre class=\"lang:default decode:true\">&lt;form action=\"\/families\" accept-charset=\"UTF-8\" method=\"post\"&gt;\r\n&lt;input type=\"hidden\" name=\"authenticity_token\" value=\"IxaTQnVhbF7QOYx0bBKu18LQhmIPW272cMKEmHN\/TIPshkw0HkMDbaB0GPbDufhiB7W43Q6vqx6F+vrGp06erQ==\" \/&gt;\r\n\/\/\u4efb\u610f\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\r\n&lt;\/form&gt;<\/pre>\n<h3>\u8a8d\u8a3c\u7528\u306e\u30c8\u30fc\u30af\u30f3\u3068\u306f\uff1f<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u540c\u3058Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u751f\u3058\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u3042\u308b\u3053\u3068\u3092\u8a3c\u660e\u3059\u308b\u5185\u5bb9<\/strong><\/span>\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u306a\u306e\u3067\u5225\u306e\u30b5\u30a4\u30c8\u304b\u3089\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u507d\u88c5\u3057\u3066\u9001\u4fe1\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u8a8d\u8a3c\u30a8\u30e9\u30fc\u306b\u306a\u308a\u5b89\u5168\u3067\u3059\u3002<\/p>\n<h3>GET\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u4f7f\u308f\u306a\u3044\u3053\u3068<\/h3>\n<p>\u3053\u306eform_with\u30d8\u30eb\u30d1\u30fc\u306b\u3088\u308bCSRF\u5bfe\u7b56\u306fPOST\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u307f\u6709\u52b9\u3067GET\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u306f\u9069\u7528\u3055\u308c\u307e\u305b\u3093\u3002<span style=\"color: #ff0000;\"><strong>GET\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u60c5\u5831\u306e\u8aad\u307f\u51fa\u3057\u306e\u307f\u306b\u4f7f\u3046\u3053\u3068\u3068\u3057\u3001\u4f55\u304b\u3089\u306e\u60c5\u5831\u306e\u767b\u9332\u3084\u66f4\u65b0\u7b49\u306e\u51e6\u7406\u306f\u5fc5\u305aPOST\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f7f\u3046\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"CSRF(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u30d5\u30a9\u30fc\u30b8\u30a7\u30ea\uff09\u3068\u306f\uff1f Web\u30a2\u30d7\u30ea\u304c\u6301\u3064\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u3057\u3066\u3001\u610f\u56f3\u3057\u306a\u3044\u5f62\u3067\u5225\u306eWeb\u30a2\u30d7\u30ea\u304b\u3089\u610f\u56f3\u3057\u306a\u3044\u30c7\u30fc\u30bf\u3092\u5143\u306eWeb\u30a2\u30d7\u30ea\u306e\u30d5\u30a9\u30fc\u30e0\u306b\u9001\u4fe1\u3059\u308b\u653b\u6483\u624b\u6cd5\uff08\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u507d\u9020\uff09\u306e\u3053\u3068\u3067\u3059 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36,9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/7383"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7383"}],"version-history":[{"count":10,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/7383\/revisions"}],"predecessor-version":[{"id":20544,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/7383\/revisions\/20544"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7383"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}