{"id":8174,"date":"2021-07-28T20:37:14","date_gmt":"2021-07-29T01:37:14","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8174"},"modified":"2021-08-19T12:48:07","modified_gmt":"2021-08-19T17:48:07","slug":"fortify-on-demand-remediation-password-management-hardcoded-password-and-privacy-violation","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8174","title":{"rendered":"Fortify on Demand Remediation &#8211; Password Management: Hardcoded Password and Privacy Violation"},"content":{"rendered":"<p>These two vulnerabilities occur in the obvious case &#8212; you&#8217;ve hard coded a password or some sort of private info (e.g. SSN) and then printed it out to the browser. Don&#8217;t do that! But it also seems to occur quite frequently when Fortify on Demand doesn&#8217;t like your variable name. As an example, I have a string that provides a consistent error message when user authentication fails.<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8175\" rel=\"attachment wp-att-8175\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8175\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-BadPassword.png\" alt=\"\" width=\"750\" height=\"61\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-BadPassword.png 750w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-BadPassword-300x24.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<p>I then print the string to the screen when the user&#8217;s logon fails. Fortify says I am disclosing the user&#8217;s password. I&#8217;m obviously not. Simply renaming the variable sorts it. Now &#8230; yes, this is silly. But it&#8217;s a lot easier than trying to convince someone in Security to manually review the code, acknowledge that something about a bad password error is a totally reasonable (and descriptive) variable name, and add an exception for your code. Since bad password is error 49, I just used that in the now less descriptive variable name [ (1) Not too many people know the LDAP error codes off the top of their head, and (2) there are actually a handful of ldap bind return codes that will print this error].<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8176\" rel=\"attachment wp-att-8176\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8176\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-LDAPErr49.png\" alt=\"\" width=\"658\" height=\"59\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-LDAPErr49.png 658w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-LDAPErr49-300x27.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>These two vulnerabilities occur in the obvious case &#8212; you&#8217;ve hard coded a password or some sort of private info (e.g. SSN) and then printed it out to the browser. Don&#8217;t do that! But it also seems to occur quite frequently when Fortify on Demand doesn&#8217;t like your variable name. As an example, I have &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,856,35,69,1329],"class_list":["post-8174","post","type-post","status-publish","format-standard","hentry","category-coding","tag-coding","tag-fortify-on-demand","tag-javascript","tag-php","tag-security","tag-web-coding"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8174","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=8174"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8174\/revisions"}],"predecessor-version":[{"id":8184,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8174\/revisions\/8184"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}