{"id":57100,"date":"2024-05-28T17:10:08","date_gmt":"2024-05-28T13:10:08","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/178814\/SA-20240527-0.txt"},"modified":"2024-05-28T17:10:08","modified_gmt":"2024-05-28T13:10:08","slug":"hawki-1-0-0-beta-1-xss-file-overwrite-session-fixation","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/hawki-1-0-0-beta-1-xss-file-overwrite-session-fixation\/","title":{"rendered":"HAWKI 1.0.0-beta.1 XSS \/ File Overwrite \/ Session Fixation"},"content":{"rendered":"<p> SEC Consult Vulnerability Lab Security Advisory &lt; 20240527-0 &gt;<br \/>=======================================================================<br \/>title: Multiple vulnerabilities<br \/>product: HAWKI (Interaction Design Team at the University of Applied<br \/>Sciences and Arts in Hildesheim\/Germany)<br \/>vulnerable version: 1.0.0-beta.1, versions before commit 146967f<br \/>fixed version: Github commit 146967f<br \/>CVE number: CVE-2024-25975, CVE-2024-25976, CVE-2024-25977<br \/>impact: high<br \/>homepage: https:\/\/github.com\/HAWK-Digital-Environments\/HAWKI<br \/>found: 2024-03-05<br \/>by: Florian Stuhlmann (Office Bochum)<br \/>Thorger Jansen (Office Bochum)<br \/>SEC Consult Vulnerability Lab<\/p>\n<p>An integrated part of SEC Consult, an Eviden business<br \/>Europe | Asia<\/p>\n<p>https:\/\/www.sec-consult.com<\/p>\n<p>=======================================================================<\/p>\n<p>Vendor description:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>&#8220;HAWKI is a didactic interface for universities based on the OpenAI API.<br \/>It is not necessary for users to create an account, the university ID<br \/>is sufficient for login &#8211; no user-related data is stored.&#8221;<\/p>\n<p>Source: https:\/\/github.com\/HAWK-Digital-Environments\/HAWKI<\/p>\n<p>Business recommendation:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>The vendor provides a patch which should be installed immediately.<\/p>\n<p>SEC Consult highly recommends to perform a thorough security review of the<br \/>product conducted by security professionals to identify and resolve potential<br \/>further security issues.<\/p>\n<p>Vulnerability overview\/description:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>1) Arbitrary File Overwrite (CVE-2024-25975)<br \/>The application implements an up- and downvote function which alters a<br \/>value within a JSON file. The POST parameters are not filtered properly<br \/>and therefore an arbitrary file can be overwritten. The file can be<br \/>controlled by an authenticated attacker, the content cannot be controlled.<br \/>It is possible to overwrite all files for which the webserver has write access.<br \/>It is required to supply a relative path (path traversal).<\/p>\n<p>2) Reflected Cross-Site-Scripting (CVE-2024-25976)<br \/>When LDAP authentication is activated in the configuration it is possible<br \/>to obtain reflected XSS execution by creating a custom URL that the<br \/>victim only needs to open in order to execute arbitrary JavaScript code in<br \/>the victim&#8217;s browser.<\/p>\n<p>3) Session Fixation (CVE-2024-25977)<br \/>The application does not change the session token when using the login or<br \/>logout functionality. An attacker can set a session token in the victim&#8217;s<br \/>browser (e.g. via XSS) and prompt the victim to log in (e.g. via a redirect<br \/>to the login page). This results in the victim&#8217;s account being taken over.<\/p>\n<p>Proof of concept:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>1) Arbitrary File Overwrite (CVE-2024-25975)<br \/>The following POST request can overwrite the file &#8220;AvatarFinanzen.png&#8221;. This<br \/>file is a default file located within the &#8220;img&#8221; folder.<\/p>\n<p>&#8212;<br \/>POST \/downvote.php HTTP\/2<br \/>Host: $host<br \/>Cookie: PHPSESSID=&lt;Session Id&gt;<br \/>Content-Type: application\/x-www-form-urlencoded<br \/>Content-Length: 25<\/p>\n<p>..\/img\/AvatarFinanzen.png<br \/>&#8212;<\/p>\n<p>Both upvote.php and downvote.php are vulnerable. The vulnerable part in<br \/>downvote.php is:<\/p>\n<p>&#8212;<br \/>[&#8230;]$id = file_get_contents(&#8220;php:\/\/input&#8221;);<br \/>$sanitizedId = htmlspecialchars($id, ENT_QUOTES, &#8216;UTF-8&#8217;);<br \/>$file = &#8220;feedback\/&#8221; . $sanitizedId;<br \/>[&#8230;]file_put_contents(&#8220;feedback\/$sanitizedId&#8221;, json_encode($json));<br \/>[&#8230;]&#8212;<\/p>\n<p>2) Reflected Cross-Site-Scripting (XSS) (CVE-2024-25976)<br \/>A call to the following URL will trigger an alertbox:<\/p>\n<p>&#8212;<br \/>https:\/\/$host\/HAWKI\/login.php\/&#8221;&gt;&lt;script&gt;alert(document.cookie)&lt;\/script&gt;<br \/>&#8212;<\/p>\n<p>This is due to a fault in the file login.php where the content of<br \/>&#8220;$_SERVER[&#8216;PHP_SELF&#8217;]&#8221; is reflected into the HTML of the website. Hence<br \/>the attacker does not need a valid account in order to exploit this issue<br \/>The following code is vulnerable:<\/p>\n<p>&#8212;<br \/>[&#8230;]$server = $_SERVER[&#8216;PHP_SELF&#8217;];<br \/>[&#8230;]echo &#8216;&lt;form action = &#8220;&#8216; . $server . &#8216;&#8221; class=&#8221;column&#8221; method = &#8220;post&#8221; &gt;<br \/>[&#8230;]&#8212;<\/p>\n<p>The vulnerability is exploitable with the Apache2 default configuration.<br \/>For other webservers, the vulnerability might not be exploitable.<\/p>\n<p>3) Session Fixation (CVE-2024-25977)<br \/>The attacker changes the value of PHPSESSID within the victim&#8217;s browser to<br \/>something like &#8220;abc&#8221;. An attacker with the same value for PHPSESSID is now<br \/>authenticated as well after the victim uses successfully logs in.<\/p>\n<p>Vulnerable \/ tested versions:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>The following version has been tested which was the latest version available<br \/>at the time of the test:<br \/>* 1.0.0-beta.1<\/p>\n<p>Vendor contact timeline:<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>2024-03-21: Contacting vendor through email referenced on Github<br \/>2024-03-22: Asking about email encryption, sending report unencrypted<br \/>as requested.<br \/>2024-04-17: Asked the vendor again to receive details regarding the timeline.<br \/>2024-04-18: Vendor provides a patch pushed to the public repository.<br \/>2024-05: Fix verification phase.<br \/>2024-05-27: Release of security advisory.<\/p>\n<p>Solution:<br \/>&#8212;&#8212;&#8212;<br \/>The vendor provides a patch which can be downloaded from<br \/>https:\/\/github.com\/HAWK-Digital-Environments\/HAWKI\/commit\/146967f3148e92d1640ffebc21d8914e2d7fb3f1<\/p>\n<p>Workaround:<br \/>&#8212;&#8212;&#8212;&#8211;<br \/>No workaround available.<\/p>\n<p>Advisory URL:<br \/>&#8212;&#8212;&#8212;&#8212;-<br \/>https:\/\/sec-consult.com\/vulnerability-lab\/<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p>SEC Consult Vulnerability Lab<br \/>An integrated part of SEC Consult, an Eviden business<br \/>Europe | Asia<\/p>\n<p>About SEC Consult Vulnerability Lab<br \/>The SEC Consult Vulnerability Lab is an integrated part of SEC Consult, an<br \/>Eviden business. It ensures the continued knowledge gain of SEC Consult in the<br \/>field of network and application security to stay ahead of the attacker. The<br \/>SEC Consult Vulnerability Lab supports high-quality penetration testing and<br \/>the evaluation of new offensive and defensive technologies for our customers.<br \/>Hence our customers obtain the most current information about vulnerabilities<br \/>and valid recommendation about the risk profile of new technologies.<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>Interested to work with the experts of SEC Consult?<br \/>Send us your application https:\/\/sec-consult.com\/career\/<\/p>\n<p>Interested in improving your cyber security with the experts of SEC Consult?<br \/>Contact our local offices https:\/\/sec-consult.com\/contact\/<br \/>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p>Mail: security-research at sec-consult dot com<br \/>Web: https:\/\/www.sec-consult.com<br \/>Blog: https:\/\/blog.sec-consult.com<br \/>Twitter: https:\/\/twitter.com\/sec_consult<\/p>\n<p>EOF Florian Stuhlmann &amp; Thorger Jansen \/ @2024<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20240527-0 &gt;=======================================================================title: Multiple vulnerabilitiesproduct: HAWKI (Interaction Design Team at the University of AppliedSciences and Arts in Hildesheim\/Germany)vulnerable version: 1.0.0-beta.1, versions before commit 146967ffixed version: Github commit 146967fCVE number: CVE-2024-25975, CVE-2024-25976, CVE-2024-25977impact: highhomepage: https:\/\/github.com\/HAWK-Digital-Environments\/HAWKIfound: 2024-03-05by: Florian Stuhlmann (Office Bochum)Thorger Jansen (Office Bochum)SEC Consult Vulnerability Lab An integrated part of &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-57100","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57100","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=57100"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/57100\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=57100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=57100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=57100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}