{"id":8180,"date":"2021-07-30T19:59:37","date_gmt":"2021-07-31T00:59:37","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8180"},"modified":"2021-08-19T11:02:37","modified_gmt":"2021-08-19T16:02:37","slug":"fortify-on-demand-remediation-header-manipulation-cookies","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8180","title":{"rendered":"Fortify on Demand Remediation &#8211; Header Manipulation: Cookies"},"content":{"rendered":"<p>This is a quick one &#8212; putting user input into a cookie is bad &#8212; they can throw in CRLF&#8217;s and add extra &#8220;stuff&#8221; into the header<\/p>\n<pre>setcookie(\"ECCKTHistoryCookieSamName\", $strLogonUserID, time()+86400, \"\/sampleTool\", $cookiescope, 1);<\/pre>\n<p>Strip out the CR, LF, and CRLF&#8217;s:<\/p>\n<pre>setcookie(\"ECCKTHistoryCookieSamName\", str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), ' ', $strLogonUserID), time()+86400, \"\/sampleTool\", $cookiescope, 1);<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a quick one &#8212; putting user input into a cookie is bad &#8212; they can throw in CRLF&#8217;s and add extra &#8220;stuff&#8221; into the header setcookie(&#8220;ECCKTHistoryCookieSamName&#8221;, $strLogonUserID, time()+86400, &#8220;\/sampleTool&#8221;, $cookiescope, 1); Strip out the CR, LF, and CRLF&#8217;s: setcookie(&#8220;ECCKTHistoryCookieSamName&#8221;, str_replace(array(&#8220;\\r\\n&#8221;, &#8220;\\n&#8221;, &#8220;\\r&#8221;), &#8216; &#8216;, $strLogonUserID), time()+86400, &#8220;\/sampleTool&#8221;, $cookiescope, 1); &nbsp;<\/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-8180","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\/8180","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=8180"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8180\/revisions"}],"predecessor-version":[{"id":8182,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8180\/revisions\/8182"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}