{"id":8187,"date":"2021-08-05T13:06:15","date_gmt":"2021-08-05T18:06:15","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8187"},"modified":"2021-08-19T13:07:17","modified_gmt":"2021-08-19T18:07:17","slug":"fortify-on-demand-remediation-command-injection","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8187","title":{"rendered":"Fortify on Demand Remediation: Command Injection"},"content":{"rendered":"<p>Any time user input is used to shell out and execute a command, you risk the user executing more than you want. I can string together commands in DOS using &amp;, in Unix using ; &#8230; and stringing together commands and then executing them can blow things up spectacularly.<\/p>\n<p>You can add any sort of filter to the user input to sort this &#8230; <em>however<\/em>, it doesn&#8217;t absolutely mean the vulnerability doesn&#8217;t exist. If your &#8220;user&#8221; input is trusted (in this case, it&#8217;s an automated process where some code calls some other code &#8230; so &#8220;passing&#8221; is good enough), no big. But if there are actual users involved, you should also filter out any characters that are used to string commands together.<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8188\" rel=\"attachment wp-att-8188\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8188\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-Command.png\" alt=\"\" width=\"422\" height=\"47\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-Command.png 422w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2021\/08\/FoD-Command-300x33.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Any time user input is used to shell out and execute a command, you risk the user executing more than you want. I can string together commands in DOS using &amp;, in Unix using ; &#8230; and stringing together commands and then executing them can blow things up spectacularly. You can add any sort of &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-8187","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\/8187","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=8187"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8187\/revisions"}],"predecessor-version":[{"id":8189,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8187\/revisions\/8189"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}