{"id":334666,"date":"2023-03-22T08:05:53","date_gmt":"2023-03-22T07:05:53","guid":{"rendered":"https:\/\/blog.jetbrains.com\/qodana\/2023\/03\/secure-your-php-code-with-taint-analysis-by-qodana\/"},"modified":"2023-09-04T16:18:53","modified_gmt":"2023-09-04T15:18:53","slug":"secure-your-php-code-with-taint-analysis-by-qodana","status":"publish","type":"qodana","link":"https:\/\/blog.jetbrains.com\/ja\/qodana\/2023\/03\/secure-your-php-code-with-taint-analysis-by-qodana\/","title":{"rendered":"Qodana\u306e\u6c5a\u67d3\u89e3\u6790\u306b\u3088\u308bPHP\u30b3\u30fc\u30c9\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4fdd\u8b77"},"content":{"rendered":"\n<p><em>\u3053\u306e\u30d6\u30ed\u30b0\u6295\u7a3f\u306f\u3001JetBrains \u306e\u30b3\u30fc\u30c9\u54c1\u8cea\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u3042\u308b Qodana \u306e\u63d0\u4f9b\u3067\u304a\u9001\u308a\u3057\u307e\u3059\u3002 Qodana \u306f\u304a\u597d\u307f\u306e CI \u30c4\u30fc\u30eb\u3067\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u9759\u7684\u89e3\u6790\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002 Qodana \u306f PhpStorm \u3084\u305d\u306e\u4ed6\u306e JetBrains IDE \u3068\u540c\u3058\u30b3\u30fc\u30c9\u30a4\u30f3\u30b9\u30da\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001IDE \u3068 CI \u74b0\u5883\u306e\u4e21\u65b9\u3067\u4e00\u8cab\u3057\u305f\u30b3\u30fc\u30c9\u54c1\u8cea\u30c1\u30a7\u30c3\u30af\u3092\u78ba\u4fdd\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059<\/em>\u3002<\/p>\n\n\n\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8106\u5f31\u6027\u3092\u60aa\u7528\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u3092\u7834\u58ca\u3059\u308b\u306b\u306f\u305f\u3063\u305f 1 \u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u5341\u5206\u3067\u3059\u3002 \u5916\u90e8\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u60aa\u610f\u306e\u3042\u308b\u5165\u529b\uff08\u300c\u30c6\u30a4\u30f3\u30c8\uff1d\u6c5a\u67d3\u300d\u3068\u3082\u547c\u3070\u308c\u307e\u3059\uff09\u304b\u3089\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4fdd\u8b77\u3059\u308b\u305f\u3081\u3001\u958b\u767a\u30c1\u30fc\u30e0\u306f\u9759\u7684\u89e3\u6790\u30eb\u30fc\u30c1\u30f3\u306b\u30c6\u30a4\u30f3\u30c8\u30c1\u30a7\u30c3\u30af\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002&nbsp;<\/p>\n\n\n\n<p>Qodana \u30c1\u30fc\u30e0\u306f\u4eca\u5e74\u6700\u521d\u306e\u30ea\u30ea\u30fc\u30b9\u3067 EAP \u3067\u306e PHP \u306e\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u3092\u5b9f\u73fe\u3057\u307e\u3057\u305f\u3002 \u3053\u306e\u6a5f\u80fd\u306f PHP 2023.1 (jetbrains\/qodana-php:2023.1-eap) \u5411\u3051\u306e Qodana \u3067\u306e\u307f\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002 PHP \u5411\u3051 Qodana \u306f\u5f53\u793e\u304c\u30ea\u30ea\u30fc\u30b9\u3057\u305f\u521d\u306e\u30ea\u30f3\u30bf\u30fc\u3067\u3042\u3063\u305f\u3081\u3001PHP \u958b\u767a\u8005\u306b\u3082\u5f53\u793e\u306e\u65b0\u3057\u3044\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd\u3092\u6700\u521d\u306b\u30c6\u30b9\u30c8\u3057\u3066\u3082\u3089\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u4eca\u5f8c\u306f\u5341\u5206\u306a\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u53ce\u96c6\u3057\u305f\u5f8c\u306b\u4ed6\u306e\u8a00\u8a9e\u3082\u8ffd\u52a0\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u3068\u305d\u306e Qodana \u3067\u306e\u4ed5\u7d44\u307f\u306b\u95a2\u3059\u308b\u8a73\u7d30\u3092\u77e5\u308b\u306b\u306f\u3001\u3053\u306e\u307e\u307e\u7d9a\u304d\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1200\" height=\"563\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/Blog_Featured_image_1280x600-4-1200x563.png\" alt=\"\" class=\"wp-image-334671\"\/><\/figure>\n\n\n\n<p><a class=\"jb-download-button\" title=\"QODANA \u3092\u7121\u6599\u3067\u8a66\u3059\" href=\"https:\/\/www.jetbrains.com\/ja-jp\/qodana\" target=\"_blank\" rel=\"noopener noreferrer\"><i class=\"download-icon\"><\/i>QODANA \u3092\u4f7f\u3044\u59cb\u3081\u308b<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u3068\u306f<\/h2>\n\n\n\n<p>\u30c6\u30a4\u30f3\u30c8\u3068\u306f\u5916\u90e8\u30e6\u30fc\u30b6\u30fc\u306b\u3088\u3063\u3066\u5909\u66f4\u3055\u308c\u308b\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3092\u3082\u305f\u3089\u3059\u53ef\u80fd\u6027\u304c\u3042\u308b\u5024\u306e\u3053\u3068\u3067\u3059\u3002 \u30b3\u30fc\u30c9\u5185\u306b\u30c6\u30a4\u30f3\u30c8\u304c\u3042\u308a\u3001\u672a\u691c\u8a3c\u306e\u5916\u90e8\u30c7\u30fc\u30bf\u304c\u30d7\u30ed\u30b0\u30e9\u30e0\u5168\u4f53\u306b\u62e1\u6563\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u5834\u5408\u3001\u30cf\u30c3\u30ab\u30fc\u306f\u3053\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u7b87\u6240\u3092\u5b9f\u884c\u3057\u3066\u3001SQL \u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u3001\u6f14\u7b97\u306e\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3001\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0\u3001\u30d1\u30b9\u30c8\u30e9\u30d0\u30fc\u30b5\u30eb\u306a\u3069\u3092\u767a\u751f\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u901a\u5e38\u3001\u30cf\u30c3\u30ab\u30fc\u306f\u3053\u306e\u3088\u3046\u306a\u8106\u5f31\u6027\u3092\u60aa\u7528\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u3092\u7834\u58ca\u3057\u3001\u8cc7\u683c\u60c5\u5831\u3084\u305d\u306e\u4ed6\u306e\u30c7\u30fc\u30bf\u3092\u5f37\u596a\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u306e\u52d5\u4f5c\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1530\" height=\"590\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-34.png\" alt=\"\" class=\"wp-image-330043\"\/><figcaption>\u30c6\u30a4\u30f3\u30c8\u306e\u4f8b\u3002 GET \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u5185\u306e\u4efb\u610f\u306e\u30c7\u30fc\u30bf\u304c\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002 \u305f\u3068\u3048\u3070\u3001\u60aa\u610f\u306e\u3042\u308b\u30e6\u30fc\u30b6\u30fc\u306f\u8106\u5f31\u6027\u3092\u60aa\u7528\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u6539\u3056\u3093\u3067\u304d\u307e\u3059\u3002&nbsp;&nbsp;<\/figcaption><\/figure>\n\n\n\n<p>\u958b\u767a\u30c1\u30fc\u30e0\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u653b\u6483\u5bfe\u8c61\u9818\u57df\u306b\u5bfe\u3057\u3066\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u76e3\u67fb\u3092\u5b9f\u884c\u3059\u308b\u969b\u3001\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u3092\u60aa\u610f\u306e\u3042\u308b\u5165\u529b\u306b\u5bfe\u3059\u308b\u8ffd\u52a0\u306e\u4fdd\u8b77\u30ec\u30a4\u30e4\u30fc\u3068\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002&nbsp;<\/p>\n\n\n\n<p><strong>\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u306f\u3001\u95a2\u6570\u307e\u305f\u306f\u30e1\u30bd\u30c3\u30c9\u306e\u672c\u4f53\u5168\u4f53\u306b\u308f\u305f\u3063\u3066\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u306e\u5165\u529b\u306e\u6d41\u308c\u3092\u8a55\u4fa1\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u3067\u3059\u3002 \u4e88\u671f\u3057\u306a\u3044\u5165\u529b\u304c\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u884c\u306b\u60aa\u5f71\u97ff\u3092\u53ca\u307c\u3055\u306a\u3044\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u3053\u3068\u3092\u57fa\u672c\u7684\u306a\u76ee\u6a19\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n\n\n\n<p><strong>\u30c6\u30a4\u30f3\u30c8\u30bd\u30fc\u30b9<\/strong>\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u6c5a\u67d3\u3055\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5834\u6240\u3092\u6307\u3057\u307e\u3059\u3002 \u6c5a\u67d3\u3055\u308c\u305f\u5165\u529b\u3092\u53d7\u3051\u5165\u308c\u3084\u3059\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u91cd\u8981\u7b87\u6240\u306f<strong>\u30c6\u30a4\u30f3\u30c8\u30b7\u30f3\u30af<\/strong>\u3068\u547c\u3070\u308c\u307e\u3059\u3002 \u3053\u306e\u30c7\u30fc\u30bf\u306f\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u307e\u305f\u306f\u4ee3\u5165\u3092\u4ecb\u3057\u3066\u30b7\u30f3\u30af\u306b\u4f1d\u64ad\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u3092\u624b\u52d5\u3067\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u5916\u90e8\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u5165\u308c\u3066\u3044\u308b\u3059\u3079\u3066\u306e\u5834\u6240\u3092\u7279\u5b9a\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u5404\u30c7\u30fc\u30bf\u3092\u8ffd\u8de1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6c5a\u67d3\u30c7\u30fc\u30bf\u306f\u591a\u6570\u306e\u30ce\u30fc\u30c9\u3067\u4f7f\u7528\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002 \u30c6\u30a4\u30f3\u30c8\u306e\u4f1d\u642c\u3092\u9632\u3050\u306b\u306f\u3001\u4ee5\u4e0b\u306b\u3042\u308b 2 \u3064\u306e\u624b\u6cd5\u306e\u3044\u305a\u308c\u304b\u3092\u53d6\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ol><li><strong>\u30c7\u30fc\u30bf\u3092\u30b5\u30cb\u30bf\u30a4\u30ba\u3059\u308b<\/strong>\u3002\u3064\u307e\u308a\u3001\u30c7\u30fc\u30bf\u3092\u5b89\u5168\u306a\u72b6\u614b\u306b\u5909\u63db\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u30c6\u30a4\u30f3\u30c8\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306b\u30bf\u30b0\u3092\u9664\u53bb\u3057\u307e\u3057\u305f\u3002&nbsp;<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"249\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-24.png\" alt=\"\" class=\"wp-image-329878\"\/><\/figure>\n\n\n\n<ol start=\"2\"><li><strong>\u30c7\u30fc\u30bf\u3092\u691c\u8a3c\u3059\u308b<\/strong>\u3002\u3064\u307e\u308a\u3001\u8ffd\u52a0\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u5fc5\u8981\u306a\u30d1\u30bf\u30fc\u30f3\u306b\u9069\u5408\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001<code>$<\/code><code>email<\/code> \u5909\u6570\u306e\u691c\u8a3c\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002&nbsp;<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"365\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-25.png\" alt=\"\" class=\"wp-image-329926\"\/><\/figure>\n\n\n\n<p>\u8981\u3059\u308b\u306b\u3001\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u306e\u30a4\u30f3\u30b9\u30da\u30af\u30b7\u30e7\u30f3\u306f\u30e6\u30fc\u30b6\u30fc\u306e\u6c5a\u67d3\u30c7\u30fc\u30bf\u3092\u305d\u306e\u30bd\u30fc\u30b9\u304b\u3089\u30b7\u30f3\u30af\u307e\u3067\u8ffd\u8de1\u3057\u3001\u30b5\u30cb\u30bf\u30a4\u30ba\u307e\u305f\u306f\u691c\u8a3c\u306a\u3057\u3067\u305d\u306e\u30c7\u30fc\u30bf\u3092\u6271\u3063\u3066\u3044\u308b\u5834\u5408\u306b\u8b66\u544a\u3092\u767a\u3057\u307e\u3059\u3002&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Qodana \u3067\u306e\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u306e\u4ed5\u7d44\u307f<\/h2>\n\n\n\n<p>\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u306f\u30d0\u30fc\u30b8\u30e7\u30f3 2023.1 EAP \u4ee5\u964d\u306e PHP \u5411\u3051 Qodana \u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002 \u3053\u306e\u6a5f\u80fd\u306b\u306f\u3001\u30b3\u30fc\u30c9\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u30c6\u30a4\u30f3\u30c8\u3068\u6f5c\u5728\u7684\u306a\u8106\u5f31\u6027\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\u3059\u308b\u30a4\u30f3\u30b9\u30da\u30af\u30b7\u30e7\u30f3\u3001PhpStorm \u3067\u554f\u984c\u3092\u958b\u3044\u3066\u305d\u306e\u5834\u3067\u5bfe\u5fdc\u3059\u308b\u6a5f\u80fd\u3001\u304a\u3088\u3073\u30c6\u30a4\u30f3\u30c8\u306e\u30d5\u30ed\u30fc\u3092\u53ef\u8996\u5316\u3059\u308b\u30c7\u30fc\u30bf\u30d5\u30ed\u30fc\u30b0\u30e9\u30d5\u304c\u542b\u307e\u308c\u307e\u3059\u3002&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f8b 1. SQL \u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3&nbsp;<\/h3>\n\n\n\n<p>SQL \u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306e\u4f8b\u3068 Qodana \u306b\u3088\u308b\u305d\u306e\u691c\u51fa\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"825\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-26.png\" alt=\"\" class=\"wp-image-329937\"\/><\/figure>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001Qodana \u306f system_admin() \u95a2\u6570\u5185\u3067\u6b21\u306e\u30c6\u30a4\u30f3\u30c8\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 1-2: \u30e6\u30fc\u30b6\u30fc\u306e\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u30c7\u30fc\u30bf\u304c\u30b5\u30cb\u30bf\u30a4\u30ba\u307e\u305f\u306f\u691c\u8a3c\u306a\u3057\u3067 <code>$<\/code><code>_POST<\/code> \u30b0\u30ed\u30fc\u30d0\u30eb\u914d\u5217\u304b\u3089\u53d6\u5f97\u3055\u308c\u3001\u5909\u6570 <code>$<\/code><code>edit<\/code> \u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u307e\u3059\u3002 <strong>\u3053\u308c\u306f\u30c6\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 3: \u6c5a\u67d3\u3055\u308c\u305f\u5909\u6570 <code>$<\/code><code>edit<\/code> \u304c\u3001\u9069\u5207\u306a\u30b5\u30cb\u30bf\u30a4\u30ba\u306a\u3057\u306b &lt;0&gt;system_save_settings<!--0--> \u95a2\u6570\u306b\u5f15\u6570\u3068\u3057\u3066\u6e21\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"527\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-27.png\" alt=\"\" class=\"wp-image-329949\"\/><\/figure>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 4: <code>$<\/code><code>edit<\/code> \u5909\u6570\u306e\u30c7\u30fc\u30bf\u304c <code>$<\/code><code>edit<\/code> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 5: <code>$<\/code><code>edit<\/code> \u5909\u6570\u304c <code>$<\/code><code>filename<\/code> \u30ad\u30fc\u3068 <code>$<\/code><code>status<\/code> \u5024\u3092\u6301\u3064 &lt;0&gt;foreach<!--0--> \u306b\u6e21\u3055\u308c\u307e\u3059\u3002 \u4e21\u65b9\u306e\u5909\u6570\u306b\u6587\u5b57\u5217\u3067\u9023\u7d50\u3055\u308c\u305f <code>$<\/code><code>edit<\/code> \u5909\u6570\u306e\u6c5a\u67d3\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002 <code>$<\/code><code>filename<\/code> \u30ad\u30fc\u304c\u6c5a\u67d3\u3055\u308c\u305f SQL \u6587\u5b57\u5217\u3068\u9023\u7d50\u3055\u308c\u305f\u3042\u3068\u3001\u6c5a\u67d3\u30c7\u30fc\u30bf\u304c &lt;0&gt;db_query<!--0--> \u306b\u6e21\u3055\u308c\u308b\u5f15\u6570\u306b\u4f1d\u64ad\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 6: <code>$<\/code><code>filename<\/code> \u30ad\u30fc\u306b\u306f\u3001\u6587\u5b57\u5217\u3067\u9023\u7d50\u3055\u308c\u305f <code>$<\/code><code>edit<\/code> \u5909\u6570\u306e\u6c5a\u67d3\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 7: <code>$<\/code><code>filename<\/code> \u30ad\u30fc\u306f\u6c5a\u67d3\u3055\u308c\u305f SQL \u6587\u5b57\u5217\u3068\u9023\u7d50\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 8: \u6c5a\u67d3\u3055\u308c\u305f SQL \u6587\u5b57\u5217\u306f\u6c5a\u67d3\u305f\u30c7\u30fc\u30bf\u3092 <code>db_query<\/code> \u306b\u6e21\u3055\u308c\u308b\u5f15\u6570\u306b\u4f1d\u64ad\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306b <code>db_query<\/code> \u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"571\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-28.png\" alt=\"\" class=\"wp-image-329960\"\/><\/figure>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 9: \u6c5a\u67d3\u3055\u308c\u305f\u6587\u5b57\u5217\u306f <code>$<\/code><code>query<\/code> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u914d\u7f6e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 10: \u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306f <code>_db_query<\/code> \u95a2\u6570\u306e\u5f15\u6570\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>_db_query<\/code> \u95a2\u6570\u306b\u79fb\u52d5\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"680\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-33.png\" alt=\"\" class=\"wp-image-330032\"\/><\/figure>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 11: <code>_db_query<\/code> \u95a2\u6570\u306e\u6700\u521d\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc <code>$query<\/code> \u306b\u3042\u308b\u6c5a\u67d3\u30c7\u30fc\u30bf\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 12: \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u30c7\u30fc\u30bf\u304c <code>mysql_query<\/code> \u95a2\u6570\u306b\u6e21\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u30b7\u30f3\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30c7\u30fc\u30bf\u30d5\u30ed\u30fc\u5168\u4f53\u304c\u3001\u30b5\u30cb\u30bf\u30a4\u30ba\u307e\u305f\u306f\u691c\u8a3c\u306a\u3057\u306b\u30c7\u30fc\u30bf\u304c <code>$_POST[\u201cedit\u201d]<\/code> \u304b\u3089 <code>mysql_query<\/code>(<code>$query<\/code>) \u306b\u3069\u306e\u3088\u3046\u306b\u79fb\u52d5\u3059\u308b\u306e\u304b\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u653b\u6483\u8005\u306f  <code>$_POST[\u201cedit\u201d]<\/code> \u306e\u30ad\u30fc\u3067\u9023\u7d50\u3055\u308c\u305f SQL \u30af\u30a8\u30ea\u3092\u64cd\u4f5c\u3057\u3001<strong>SQL \u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3<\/strong>\u3092\u30c8\u30ea\u30ac\u30fc\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>Qodana\u306f\u6c5a\u67d3\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u4f7f\u7528\u3055\u308c\u308b\u3059\u3079\u3066\u306e\u30ce\u30fc\u30c8\u3068\u5171\u306b\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u5185\u306e\u3053\u308c\u3089\u306e\u30ea\u30b9\u30af\u3092\u898b\u3064\u3051\u51fa\u3059\u305f\u3081\u3001\u3059\u3079\u3066\u306e\u6c5a\u67d3\u30c7\u30fc\u30bf\u3092\u6642\u9593\u5185\u306b\u30b5\u30cb\u30bf\u30a4\u30ba\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/resources.jetbrains.com\/storage\/products\/blog\/wp-content\/uploads\/Qodana\/taint-open.gif\" alt=\"\"\/><figcaption>PhpStorm \u3067\u554f\u984c\u3092\u958b\u304f<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f8b 2. XSS \u306e\u554f\u984c<\/h3>\n\n\n\n<p>Qodana UI \u3067\u306f\u3001\u5168\u4f53\u306e\u30c6\u30a4\u30f3\u30c8\u306e\u30d5\u30ed\u30fc\u3092\u53ef\u8996\u5316\u3059\u308b\u30b0\u30e9\u30d5\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002 \u3053\u3061\u3089\u306f Qodana \u304c XSS \u8106\u5f31\u6027\u3092\u53ef\u8996\u5316\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002\u3053\u308c\u306b\u306f\u30de\u30fc\u30ab\u30fc 5 \u3067\u30de\u30fc\u30b8\u3055\u308c\u308b 2 \u3064\u306e\u30bd\u30fc\u30b9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1310\" height=\"750\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-29.png\" alt=\"\" class=\"wp-image-329971\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1170\" height=\"714\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-30.png\" alt=\"\" class=\"wp-image-329982\"\/><\/figure>\n\n\n\n<p><strong>\u30bd\u30fc\u30b9 1<\/strong><\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 1-2: searchUpdate.pos \u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30fc\u30bf\u304c\u8aad\u307f\u53d6\u3089\u308c\u3001\u6c5a\u67d3\u30c7\u30fc\u30bf\u304c <code>$<\/code><code>start<\/code> \u5909\u6570\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30bd\u30fc\u30b9 2<\/strong><\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 3-4: \u30d1\u30b9\u304c <code>$<\/code><code>posFile<\/code> \u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u306e\u30c7\u30fc\u30bf\u304c\u8aad\u307f\u53d6\u3089\u308c\u3001\u6c5a\u67d3\u30c7\u30fc\u30bf\u304c <code>$<\/code><code>start<\/code> \u5909\u6570\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 5: <code>$<\/code><code>start<\/code> \u5909\u6570\u306e\u3059\u3079\u3066\u306e\u6761\u4ef6\u5206\u5c90\u304b\u3089\u30de\u30fc\u30b8\u3055\u308c\u305f\u6c5a\u67d3\u72b6\u614b\u304c &lt;0&gt;doUpdateSearchIndex<!--0--> \u30e1\u30bd\u30c3\u30c9\u306b\u5f15\u6570\u3068\u3057\u3066\u6e21\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>doUpdateSearchIndex()<\/code> \u30e1\u30bd\u30c3\u30c9\u5185\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1170\" height=\"522\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-31.png\" alt=\"\" class=\"wp-image-329994\"\/><\/figure>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 6-8: <code>$<\/code><code>start<\/code> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u306f\u3053\u306e\u30c7\u30fc\u30bf\u30d5\u30ed\u30fc\u30b9\u30e9\u30a4\u30b9\u3067\u306e\u6c5a\u67d3\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3001<code>output<\/code> \u30e1\u30bd\u30c3\u30c9\u3078\u306e\u5f15\u6570\u3068\u3057\u3066\u9023\u7d50\u6587\u5b57\u5217\u5185\u306b\u6e21\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>output<\/code> \u30e1\u30bd\u30c3\u30c9\u5185\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1170\" height=\"764\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2023\/03\/image-32.png\" alt=\"\" class=\"wp-image-330005\"\/><\/figure>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 9: \u9001\u4fe1\u3055\u308c\u305f\u6587\u5b57\u5217\u5185\u306b\u542b\u307e\u308c\u308b\u6c5a\u67d3\u30c7\u30fc\u30bf\u306f <code>$<\/code><code>out<\/code> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u914d\u7f6e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30de\u30fc\u30ab\u30fc 10: <code>$<\/code><code>out<\/code> \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u304b\u3089\u306e\u30c7\u30fc\u30bf\u306f\u30b5\u30cb\u30bf\u30a4\u30ba\u306a\u3057\u3067 <code>print<\/code> \u95a2\u6570\u306b\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002 \u3053\u306e\u95a2\u6570\u306f\u30b7\u30f3\u30af\u3067 XSS \u306e\u8106\u5f31\u6027\u3092\u767a\u751f\u3055\u305b\u308b\u305f\u3081\u3001\u60aa\u7528\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8106\u5f31\u6027\u3092\u60aa\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u653b\u6483\u8005\u306f\u4f8b\u3048\u3070\u30de\u30fc\u30ab\u30fc 1 \u304a\u3088\u3073 2 \u306e\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u306e\u4ee3\u308f\u308a\u306b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u3001\u30b5\u30cb\u30bf\u30a4\u30ba\u3055\u308c\u3066\u3044\u306a\u3044 print \u95a2\u6570\u306e\u7d50\u679c\u3068\u3057\u3066\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u306b\u3069\u3093\u306a\u60c5\u5831\u3067\u3082\u8f09\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>Qodana \u306f\u3053\u306e\u8106\u5f31\u6027\u306b\u3064\u3044\u3066\u8b66\u544a\u3057\u3066\u512a\u5148\u5ea6\u3092\u9ad8\u3081\u308b\u3053\u3068\u3067\u3001\u65e9\u6025\u306b\u8106\u5f31\u6027\u3092\u89e3\u6c7a\u3057\u3066\u30cf\u30c3\u30af\u3092\u4e88\u9632\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u306f\u60aa\u7528\u3055\u308c\u3046\u308b\u653b\u6483\u5bfe\u8c61\u9818\u57df\u306e\u6392\u9664\u306b\u5f79\u7acb\u3064\u305f\u3081\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306b\u5bfe\u3059\u308b\u30ea\u30b9\u30af\u3092\u8efd\u6e1b\u3059\u308b\u306e\u306b\u52b9\u679c\u7684\u306a\u65b9\u6cd5\u3067\u3059\u3002 \u30c6\u30a4\u30f3\u30c8\u89e3\u6790\u3068 Qodana \u306e\u8a73\u7d30\u306f\u3001<a title=\"https:\/\/www.jetbrains.com\/help\/qodana\/getting-started.html\" href=\"https:\/\/www.jetbrains.com\/help\/qodana\/2023.1\/taint-analysis.html\" target=\"_blank\" rel=\"noreferrer noopener\">Qodana \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a class=\"jb-download-button\" title=\"QODANA \u3092\u4f7f\u3044\u59cb\u3081\u308b\" href=\"https:\/\/www.jetbrains.com\/ja-jp\/qodana\" target=\"_blank\" rel=\"noopener noreferrer\"><i class=\"download-icon\"><\/i>QODANA \u3092\u4f7f\u3044\u59cb\u3081\u308b<\/a><\/p>\n\n\n\n<p>\u30b3\u30fc\u30c9\u3092\u5065\u5168\u306b\u4fdd\u3061\u306a\u304c\u3089\u3001\u958b\u767a\u3092\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n<p><strong>\u30aa\u30ea\u30b8\u30ca\u30eb\uff08\u82f1\u8a9e\uff09\u30d6\u30ed\u30b0\u6295\u7a3f\u306e\u4f5c\u8005\uff1a<\/strong><\/p>\n\n\n    <div class=\"about-author \">\n        <div class=\"about-author__box\">\n            <div class=\"row\">\n                <div class=\"about-author__box-img\">\n                    <img decoding=\"async\" src=\"https:\/\/secure.gravatar.com\/avatar\/?s=200&#038;r=g\" width=\"200\" height=\"200\" alt=\"\" loading=\"lazy\"  class=\"avatar avatar-200 wp-user-avatar wp-user-avatar-200 photo avatar-default\">\n                <\/div>\n                <div class=\"about-author__box-text\">\n                                                        <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n","protected":false},"author":1394,"featured_media":334671,"comment_status":"closed","ping_status":"closed","template":"","categories":[4089,947,89,907,6366],"tags":[991,76,190,45,477],"cross-post-tag":[6637],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/qodana\/334666"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/qodana"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/types\/qodana"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/users\/1394"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/comments?post=334666"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/qodana\/334666\/revisions"}],"predecessor-version":[{"id":335565,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/qodana\/334666\/revisions\/335565"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/media\/334671"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/media?parent=334666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/categories?post=334666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/tags?post=334666"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ja\/wp-json\/wp\/v2\/cross-post-tag?post=334666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}