{"id":8160,"date":"2021-07-20T20:22:40","date_gmt":"2021-07-21T01:22:40","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8160"},"modified":"2021-08-19T10:24:38","modified_gmt":"2021-08-19T15:24:38","slug":"fortify-on-demand-remediation-xss-reflected","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8160","title":{"rendered":"Fortify on Demand Remediation &#8211; XSS Reflected"},"content":{"rendered":"<p>This vulnerability occurs when you accept user input and then use that input in output. The solution is to <em>sanitize<\/em> the input. The <a class=\"external-link\" href=\"https:\/\/www.php.net\/manual\/en\/function.filter-var.php\" target=\"_blank\" rel=\"nofollow noopener\" data-ext-link-init=\"true\">filter_var<\/a> or <a class=\"external-link\" href=\"https:\/\/www.php.net\/manual\/en\/function.filter-input.php\" target=\"_blank\" rel=\"nofollow noopener\" data-ext-link-init=\"true\">filter_input<\/a> functions can be used with a variety of <a class=\"external-link\" href=\"https:\/\/www.php.net\/manual\/en\/filter.filters.sanitize.php\" target=\"_blank\" rel=\"nofollow noopener\" data-ext-link-init=\"true\">sanitize filters<\/a>.<\/p>\n<p>As an example, code to accept what <em>should<\/em> be an integer value from user input:<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0\u00a0$iVariable = $_POST['someUserInput'];<\/pre>\n<p>Becomes code that removes all characters except for digits (and + or &#8211; signs) from the input:<\/p>\n<pre>\u00a0\u00a0\u00a0\u00a0 $iVariable = filter_input(INPUT_POST, 'someUserInput', FILTER_SANITIZE_NUMBER_INT);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This vulnerability occurs when you accept user input and then use that input in output. The solution is to sanitize the input. The filter_var or filter_input functions can be used with a variety of sanitize filters. As an example, code to accept what should be an integer value from user input: \u00a0\u00a0\u00a0\u00a0\u00a0$iVariable = $_POST[&#8216;someUserInput&#8217;]; Becomes &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[45,1437,35,69,1329],"class_list":["post-8160","post","type-post","status-publish","format-standard","hentry","category-coding","tag-coding","tag-fortify-on-demand","tag-php","tag-security","tag-web-coding"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8160"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8160\/revisions"}],"predecessor-version":[{"id":8161,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8160\/revisions\/8161"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}