{"id":367,"date":"2018-04-01T08:18:02","date_gmt":"2018-03-31T23:18:02","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=367"},"modified":"2023-05-27T23:04:04","modified_gmt":"2023-05-27T14:04:04","slug":"%e3%80%90web%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e3%80%91xss%e3%82%af%e3%83%ad%e3%82%b9%e3%82%b5%e3%82%a4%e3%83%88%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%86%e3%82%a3%e3%83%b3","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=367","title":{"rendered":"\u3010Web\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3011XSS(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0)\u5bfe\u7b56\u306e\u57fa\u672c(Java\u3084Rails\u3001breakman\u306a\u3069\uff09"},"content":{"rendered":"<p>\u6709\u540d\u306a\u8106\u5f31\u6027\u3068\u3057\u3066\u3001XSS(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0)\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306a\u77e5\u8b58\u3092\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n<h2>XSS\u3068\u306f\uff1f<\/h2>\n<p>\u30e6\u30fc\u30b6\u30fc\u306b\u8868\u793a\u3059\u308b\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u60aa\u610f\u306e\u3042\u308b\u30b9\u30af\u30ea\u30d7\u30c8\uff08\u4e3b\u306bJavaScript)\u3092\u4ed5\u639b\u3051\u3066\u3001\u305d\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u8868\u793a\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3055\u305b\u308b\u3053\u3068\u3067\u4efb\u610f\u64cd\u4f5c\u3092\u884c\u308f\u305b\u308b\u653b\u6483\u3067\u3059\u3002<\/p>\n<h2>XSS\u306e\u30e1\u30ab\u30cb\u30ba\u30e0<\/h2>\n<p>\u30d6\u30e9\u30a6\u30b6\u306f\u57fa\u672c\u7684\u306bJavaScript\u306e\u60aa\u7528\u3092\u9632\u3050\u305f\u3081<span style=\"color: #ff0000;\"><strong>\u300c\u540c\u4e00\u30aa\u30ea\u30b8\u30f3\u30dd\u30ea\u30b7\u30fc\u300d<\/strong><span style=\"color: #000000;\">\u3068\u3044\u3046\u5236\u9650\u3092\u8a2d\u3051\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u5236\u9650\u306e\u5143\u3067\u306f\u3042\u308b\u30aa\u30ea\u30b8\u30f3\u304b\u3089\u4ed6\u306e\u30aa\u30ea\u30b8\u30f3\u3078\u306eAjax\u901a\u4fe1\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3001XSS\u306f\u7b2c\u4e09\u8005\u306e\u540c\u4e00\u30aa\u30ea\u30b8\u30f3\u306b\u6210\u308a\u6e08\u307e\u3057\u3066\u60aa\u610f\u3042\u308b\u64cd\u4f5c\u3092\u884c\u304a\u3046\u3068\u3057\u307e\u3059\u3002<\/span><\/span><\/p>\n<h4>\u30aa\u30ea\u30b8\u30f3\u3068\u306f\uff1f<\/h4>\n<p>\u30d7\u30ed\u30c8\u30b3\u30eb\u3001\u30db\u30b9\u30c8\u3001\u30dd\u30fc\u30c8\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h2>XSS\u306e\u5f71\u97ff\u3001\u88ab\u5bb3<\/h2>\n<ul>\n<li>\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u653b\u6483\u8005\u304c\u7528\u610f\u3057\u305fJavaScript\u306e\u5b9f\u884c\u306b\u3088\u308a\u30af\u30c3\u30ad\u30fc\u60c5\u5831\u3092\u76d7\u307e\u308c\u6210\u308a\u3059\u307e\u3055\u308c\u3066\u3057\u307e\u3046\u3002<\/li>\n<li>Web\u30b5\u30a4\u30c8\u4e0a\u306b\u507d\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u3066\u30d5\u30a3\u30c3\u30b7\u30f3\u30b0\u306b\u3088\u308a\u500b\u4eba\u60c5\u5831\u304c\u76d7\u307e\u308c\u308b\u3002<\/li>\n<\/ul>\n<h2>\u767a\u751f\u7b87\u6240<\/h2>\n<ul>\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3001HTML\u30bf\u30b0\u3092\u751f\u6210\u3057\u3066\u3044\u308b\u7b87\u6240<\/li>\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3001JavaScript\u3092\u751f\u6210\u3057\u3066\u3044\u308b\u7b87\u6240<\/li>\n<\/ul>\n<p>\u4f8b\u3048\u3070\u3001\u5bfe\u7b56\u304c\u3055\u308c\u3066\u3044\u306a\u3044\u30da\u30fc\u30b8\u3067\u306f\u3001JavaScript\u3067\u7c21\u5358\u306b\u30af\u30c3\u30ad\u30fc\u306e\u60c5\u5831\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u5bfe\u7b56\u306e\u57fa\u672c<\/h2>\n<h3>Web\u30a2\u30d7\u30ea\u306e\u958b\u767a\u8005\u304c\u3067\u304d\u308b\u5bfe\u7b56<\/h3>\n<p>\u30fb\u5c5e\u6027\u5024\u306f\u30c0\u30d6\u30eb\u30b3\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3(\")\u3067\u56f2\u3080\u3053\u3068\u3002<\/p>\n<p>\u30fb\u4e0b\u8a18\u306eHTML\u306e5\u7a2e\u985e\u306e\u7279\u6b8a\u6587\u5b57\u3092\u4f7f\u3046\u5834\u5408\u306f\u3001\u30a8\u30b9\u30b1\u30fc\u30d7(\u30b5\u30cb\u30bf\u30a4\u30b8\u30f3\u30b0)\u3059\u308b\u3053\u3068\u3002<\/p>\n<div class=\"graybox\">\u300c&lt;\u300d\u300c&gt;\u300d\u300c&amp;\u300d\u300c\"\u300d\u300c'\u300d<\/div>\n<div><\/div>\n<p>\u5b9f\u969b\u306b\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3001XSS\u306e\u653b\u6483\u3068\u5bfe\u7b56\u3092\u3084\u3063\u3066\u307f\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5b9f\u65bd\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"htv4y0gdUW\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=577\">\u3010Web\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3011Java\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3067\u3001XSS\u3092\u4f53\u9a13\u3057\u3066\u307f\u308b\u3002<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=577&#038;embed=true#?secret=htv4y0gdUW\" data-secret=\"htv4y0gdUW\" width=\"500\" height=\"282\" title=\"&#8220;\u3010Web\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3011Java\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u3067\u3001XSS\u3092\u4f53\u9a13\u3057\u3066\u307f\u308b\u3002&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h3>Rails\u3067\u306e\u5bfe\u7b56<\/h3>\n<p>Rails\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u308b\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305f\u3060\u3001\u4e0a\u8a18\u306e\u6587\u5b57\u3092\u5168\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u305f\u3044\u304b\u3068\u3044\u3048\u3070\u305d\u3046\u3067\u3082\u306a\u3044\u5834\u5408\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30d8\u30eb\u30d1\u30fc\u3092\u4f7f\u3063\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u3092\u30b9\u30ad\u30c3\u30d7\u3055\u305b\u307e\u3059\u3002<\/p>\n<div><\/div>\n<ul>\n<li>raw\u30d8\u30eb\u30d1\u30fc<\/li>\n<li>String#html_safe<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001Slim\u3067\u306f\u300c==\u300d\u3067\u5024\u3092\u5c55\u958b\u3057\u305f\u5834\u5408\u306fHTML\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u9006\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u305d\u306e\u307e\u307e\u51fa\u3057\u305f\u3044\u304c\u5371\u967a\u306a\u30bf\u30b0\u3092\u51fa\u529b\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u5371\u967a\u306a\u30bf\u30b0\u306b\u3060\u3051\u300csanitize\u30d8\u30eb\u30d1\u30fc\u300d\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h4>breakman\u3068\u306f\uff1f<\/h4>\n<p>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u91cd\u70b9\u3092\u7f6e\u3044\u305fRails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3067\u3059\u3002XSS\u7cfb\u306e\u8106\u5f31\u6027\u306e\u691c\u77e5\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<h5>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">group :development, :test do\r\n  gem 'brakeman',                  '~&gt; 4.7.2',  require: false\r\nend<\/pre>\n<h5>\u5b9f\u884c<\/h5>\n<p>\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u30a2\u30d7\u30ea\u304c\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u304a\u3044\u3066\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">bundle exec breakman<\/pre>\n<h5>\u7528\u9014<\/h5>\n<p>CI\/CD\u306e\u30c1\u30a7\u30c3\u30af\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3068\u3057\u3066\u4f7f\u308f\u308c\u3066\u3044\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<h5>\u30aa\u30d7\u30b7\u30e7\u30f3<\/h5>\n<h6>-q<\/h6>\n<p>\u300cquiet\u300d\u306e\u3053\u3068\u3092\u6307\u3057\u3066\u304a\u308a\u51fa\u529b\u3055\u308c\u308b\u60c5\u5831\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6291\u5236\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6709\u540d\u306a\u8106\u5f31\u6027\u3068\u3057\u3066\u3001XSS(\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0)\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306a\u77e5\u8b58\u3092\u307e\u3068\u3081\u307e\u3059\u3002 XSS\u3068\u306f\uff1f \u30e6\u30fc\u30b6\u30fc\u306b\u8868\u793a\u3059\u308b\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u60aa\u610f\u306e\u3042\u308b\u30b9\u30af\u30ea\u30d7\u30c8\uff08\u4e3b\u306bJavaScript)\u3092\u4ed5\u639b\u3051\u3066\u3001\u305d\u306e\u30b3\u30f3\u30c6 [&hellip;]","protected":false},"author":1,"featured_media":507,"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\/367"}],"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=367"}],"version-history":[{"count":29,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":20557,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/367\/revisions\/20557"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/507"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}