{"id":34450,"date":"2022-12-05T19:28:29","date_gmt":"2022-12-05T16:28:29","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/170098\/drupalhsp200-traversal.txt"},"modified":"2022-12-12T11:23:40","modified_gmt":"2022-12-12T07:53:40","slug":"drupal-h5p-module-2-0-0-zip-slip-traversal-drupal","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/drupal-h5p-module-2-0-0-zip-slip-traversal-drupal\/","title":{"rendered":"Drupal H5P Module 2.0.0 Zip Slip Traversal Drupal"},"content":{"rendered":"<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nDrupal H5P Module &lt;= 2.0.0 (isValidPackage) Zip Slip Vulnerability<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n[-] Software Link:<\/p>\n<p>https:\/\/www.drupal.org\/project\/h5p<\/p>\n[-] Affected Versions:<\/p>\n<p>Version 2.0.0-alpha2 and prior versions.<br \/>\nVersion 7.x-1.50 and prior versions.<\/p>\n[-] Vulnerability Description:<\/p>\n<p>The vulnerability is located within the H5PValidator::isValidPackage()<br \/>\nmethod. This implements the following check in order to skip any file or<br \/>\nfolder starting with a dot or underscore within the uploaded h5p<br \/>\narchive:<\/p>\n<p>891. $fileName = $zip-&gt;statIndex($i)[&#8216;name&#8217;];<br \/>\n892.<br \/>\n893. if (preg_match(&#8216;\/(^[\\._]|\\\/[\\._])\/&#8217;, $fileName) !== 0) {<br \/>\n894. continue; \/\/ Skip any file or folder starting with a . or _<br \/>\n894. }<\/p>\n<p>This regex check should be enough to prevent path traversal attacks<br \/>\nthrough zipped filenames (Zip Slip attacks), because it checks for the<br \/>\nstring \u201c\/.\u201d within the filename, thus preventing directory traversal<br \/>\nattacks. However, the vulnerability exists if Drupal is running on a<br \/>\nWindows server, because in this case the attacker can provide a<br \/>\nmalicious h5p archive containing a filename with path traversal<br \/>\nsequences like \u201c..\\..\\..\u201d, which would bypass the above regex check.<br \/>\nThis can be exploited to write (or overwrite) semi-arbitrary files in<br \/>\nthe file system via directory traversal sequences, potentially leading<br \/>\nto Stored Cross-Site Scripting (XSS) and other kind of attacks.<\/p>\n[-] Solution:<\/p>\n<p>No official solution is currently available.<\/p>\n[-] Disclosure Timeline:<\/p>\n[22\/11\/2021] &#8211; Vendor notified<br \/>\n[28\/02\/2022] &#8211; Vendor proposed a possible patch<br \/>\n[28\/02\/2022] &#8211; Vendor notified about the ineffective patch, provided a<br \/>\nfix suggestion<br \/>\n[01\/03\/2022] &#8211; Vendor fixed the previous patch<br \/>\n[30\/03\/2022] &#8211; Asked update about the public disclosure and release of a<br \/>\npatch, no response<br \/>\n[22\/11\/2022] &#8211; After one year still no official solution available<br \/>\n[03\/12\/2022] &#8211; Public disclosure<\/p>\n[-] CVE Reference:<\/p>\n<p>The Common Vulnerabilities and Exposures project (cve.mitre.org)<br \/>\nhas not assigned a CVE identifier for this vulnerability.<\/p>\n[-] Credits:<\/p>\n<p>Vulnerability discovered by Egidio Romano.<\/p>\n[-] Other References:<\/p>\n<p>https:\/\/security.drupal.org\/node\/175968<\/p>\n[-] Original Advisory:<\/p>\n<p>http:\/\/karmainsecurity.com\/KIS-2022-06<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Drupal H5P Module &lt;= 2.0.0 (isValidPackage) Zip Slip Vulnerability &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; [-] Software Link: https:\/\/www.drupal.org\/project\/h5p [-] Affected Versions: Version 2.0.0-alpha2 and prior versions. Version 7.x-1.50 and prior versions. [-] Vulnerability Description: The vulnerability is located within the H5PValidator::isValidPackage() method. This implements the following check in order to skip any file or folder starting with a &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-34450","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/34450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=34450"}],"version-history":[{"count":2,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/34450\/revisions"}],"predecessor-version":[{"id":34778,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/34450\/revisions\/34778"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=34450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=34450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=34450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}