{"id":6849,"date":"2023-04-12T22:49:49","date_gmt":"2023-04-12T22:49:49","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=6849"},"modified":"2023-06-05T09:35:00","modified_gmt":"2023-06-05T09:35:00","slug":"cookies-missing-attributes-in-rdweb-gateway","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/cookies-missing-attributes-in-rdweb-gateway","title":{"rendered":"Cookies Missing Attributes in RDWeb Gateway"},"content":{"rendered":"\n<p>The HTTPOnly attribute makes cookies inaccessible to JavaScript. Additionally, the Secure attribute<br>ensures that the cookie may only be transmitted over HTTPS. Cookies used by the application did<br>not have the HTTPOnly or Secure attribute set. This included but was not limited to the session<br>cookie PTISessionID.<\/p>\n\n\n\n<p><br>Risk Rating \u2013 Medium (Likelihood: Unlikely; Impact: Moderate)<br>These cookies are accessible by client-side scripts and can be stolen in a cross-site scripting attack. In<br>the case of a session or user identification cookie, this can lead to account compromise<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2023\/04\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"368\" height=\"342\" src=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2023\/04\/image-3.png\" alt=\"\" class=\"wp-image-6850 img-responsive\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2023\/04\/image-3.png 368w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2023\/04\/image-3-300x279.png 300w\" sizes=\"auto, (max-width: 368px) 100vw, 368px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Enable Secure Flag in IIS<br><\/strong>To enable secure flag in IIS, it is better to use URL Rewrite and add the following to your web.config file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;system.webServer&gt;\n  &lt;rewrite&gt;\n    &lt;outboundRules&gt;\n      &lt;rule name=\"Use only secure cookies\" preCondition=\"Unsecured cookie\"&gt;\n        &lt;match serverVariable=\"RESPONSE_SET_COOKIE\" pattern=\".*\" negate=\"false\" \/&gt;\n        &lt;action type=\"Rewrite\" value=\"{R:0}; secure\" \/&gt;\n      &lt;\/rule&gt;\n      &lt;preConditions&gt;\n        &lt;preCondition name=\"Unsecured cookie\"&gt;\n          &lt;add input=\"{RESPONSE_SET_COOKIE}\" pattern=\".\" \/&gt;\n          &lt;add input=\"{RESPONSE_SET_COOKIE}\" pattern=\"; secure\" negate=\"true\" \/&gt;\n        &lt;\/preCondition&gt;\n      &lt;\/preConditions&gt;\n    &lt;\/outboundRules&gt;\n  &lt;\/rewrite&gt;\n&lt;\/system.webServer&gt;<\/code><\/pre>\n\n\n\n<p>Pre-Conditions wasn&#8217;t working on another site so I used this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;rewrite&gt;\n        &lt;outboundRules&gt;\n            &lt;rule name=\"Add HttpOnly\"&gt;\n                &lt;match serverVariable=\"RESPONSE_Set_Cookie\" pattern=\".+\" \/&gt;\n                &lt;conditions&gt;\n                    &lt;add input=\"{R:0}\" pattern=\"; HttpOnly\" negate=\"true\" \/&gt;\n                &lt;\/conditions&gt;\n                &lt;action type=\"Rewrite\" value=\"{R:0}; HttpOnly\" \/&gt;\n            &lt;\/rule&gt;\n            &lt;rule name=\"Add Secure\"&gt;\n                &lt;match serverVariable=\"RESPONSE_Set_Cookie\" pattern=\".+\" \/&gt;\n                &lt;conditions&gt;\n                    &lt;add input=\"{R:0}\" pattern=\"; Secure\" negate=\"true\" \/&gt;\n                &lt;\/conditions&gt;\n                &lt;action type=\"Rewrite\" value=\"{R:0}; Secure\" \/&gt;\n            &lt;\/rule&gt;\n        &lt;\/outboundRules&gt;\n    &lt;\/rewrite&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The HTTPOnly attribute makes cookies inaccessible to JavaScript. Additionally, the Secure attributeensures that the cookie may only be transmitted over HTTPS. Cookies used by the application didnot [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6849","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=6849"}],"version-history":[{"count":2,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6849\/revisions"}],"predecessor-version":[{"id":6942,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/6849\/revisions\/6942"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=6849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=6849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=6849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}