Skip to content
XSS Disclosed report Intermediate

XSS at TikTok Ads Endpoint

A reflected XSS existed on a TikTok Ads endpoint because user data was not escaped or encoded. An attacker could inject JavaScript that would execute in a victim's browser; the reporter claimed this could lead to account takeover.

s3c Follow

Originally disclosed on HackerOne

  • Triaged in 2 days
  • Fixed in 9 days
  • Paid in 7 days
  • Disclosed after 5 months

Summary by the program

A Cross-Site Scripting (XSS) vulnerability was found on a TikTok Ads endpoint, due to a lack of appropriate HTML escaping or output encoding on the reflection of user-supplied data, which was resolved on September 7, 2022. This could have resulted in a JavaScript payload injected into the endpoint causing it to be executed within the context of the victim's browser. We thank @s3c for reporting this to our team.

Summary by the researcher

I found a Cross-site scripting (XSS) and bypassed the WAF (akamai) on one of the TikTok ads endpoints and could lead it to takeover any account on ads.tiktok.com

The original report as published on HackerOne, by s3c. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is an endpoint on ads.tiktok.com, the TikTok Ads platform. The researcher, credited as s3c, reported a reflected cross-site scripting (XSS) issue there. The program's own summary states that the flaw came from a lack of appropriate HTML escaping or output encoding when user-supplied data was reflected back to the browser, and that it was resolved on 7 September 2022. The report was disclosed on 27 January 2023 and is rated high severity.

The researcher's summary is brief. In their words:

I found a Cross-site scripting (XSS) and bypassed the WAF (akamai) on one of the TikTok ads endpoints and could lead it to takeover any account on ads.tiktok.com

So there are two elements to the finding: a reflected XSS on an ads endpoint, and a bypass of the Akamai web application firewall that would otherwise have blocked the payload. The report does not name the specific endpoint path, the parameter that reflected the input, the payload used, or the technique used to get past the WAF. No HTTP request or response is included, and no reproduction steps are given beyond the one-line summary. There are no screenshots or videos.

The program's summary describes the consequence in general terms: a JavaScript payload injected into the endpoint would be executed within the context of the victim's browser. The researcher goes further and says the issue could be used to take over any account on ads.tiktok.com. The report does not describe how that escalation would work, and no bounty amount is stated.

Root cause

The program attributes the bug to missing or inadequate output encoding: user-supplied data was reflected into an HTML response without being escaped for the context it landed in. That is the classic precondition for reflected XSS. The researcher bypassed the Akamai WAF in front of the endpoint, so the filter did not stop the payload.

Impact

Within the report's own framing, the impact is script execution in the victim's browser session on the ads platform. Because the researcher states the endpoint could be used to take over any account on ads.tiktok.com, the implied impact is account takeover of accounts on ads.tiktok.com.. The report does not demonstrate that chain, so treat the takeover claim as the researcher's assertion rather than a documented result. The program's summary keeps to the more conservative statement that a payload would execute in the victim's browser context.

How this kind of bug works

Reflected XSS happens when an application takes input from the request and writes it into the response without encoding it for the place it appears. The browser parses the response as HTML (or as part of a script, attribute or URL) and treats the injected characters as markup or code rather than data. Because the script runs under the origin of the vulnerable site, it can read cookies not marked HttpOnly, act on the user's behalf through the site's own APIs, and read data the page can access.

The delivery step matters: the attacker needs the victim to make a request containing the payload, usually by sending a crafted link. Defences fall into three layers. Output encoding at the point of reflection, chosen for the correct context, is the primary fix. A restrictive Content Security Policy limits what injected script can do even when encoding fails. Input validation and WAF rules reduce the volume of attempts but are not a substitute for encoding, since filters can often be bypassed, as this report illustrates.

How to test for it

  1. Map the parameters that end up in the response: query strings, path segments, fragment-driven client-side rendering, and form fields that are echoed back on error or confirmation pages.
  2. Send a benign marker value and locate every place it appears in the response body, headers and any reflected redirect targets.
  3. For each reflection, identify the context: between tags, inside an attribute, inside a quoted JavaScript string, inside a URL. The context determines which characters need to break out.
  4. Send context-appropriate probe characters and observe whether they are encoded, stripped or passed through unchanged. A positive result is a response where your input changes the parsed structure of the page, confirmed by the browser executing your marker rather than by string matching alone.
  5. If a WAF blocks the obvious payload, vary encoding, case, event handlers and tag choices, and check whether the block is at the edge or in the application.

Common false positives: the marker appears only inside an HTML-encoded context and cannot break out; the reflection lands in a JavaScript string that is itself safely escaped; the payload fires only in a browser with extensions or developer settings that alter parsing; or the input is reflected but the response is served with a content type that prevents HTML interpretation. Always confirm execution in a real browser before reporting.

How it is fixed

Encode output at the point of reflection using a library that is aware of the target context (HTML, attribute, JavaScript, CSS, URL). Prefer allow-list validation for values that have a known shape. Set a Content Security Policy that disallows inline script and restricts script sources. Mark session cookies HttpOnly and SameSite so that script execution cannot read them directly. Treat WAF rules as defence in depth and fix the underlying encoding gap.

Hunting notes

Reflected XSS tends to hide in search and filter parameters, error and redirect messages, locale and theme switches, and any parameter whose value is echoed into a page template. Advertising and business dashboards are productive because they mix many parameters with complex templates. Recon signals include parameters that appear verbatim in responses, endpoints that reflect input into JavaScript configuration blocks, and applications sitting behind a WAF where simple payloads are blocked but the reflection itself is unencoded.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

TikTok Ads is the part of TikTok where businesses buy and manage advertising. It lives at ads.tiktok.com.

A security researcher credited as s3c found a problem on one of the pages of that platform. The problem is called reflected cross-site scripting, usually shortened to XSS. The program's own summary explains the cause: the page took some data supplied by the user and sent it back to the browser without properly escaping it. Escaping means converting characters that a browser would treat as instructions into harmless text. When that step is missing, an attacker can slip instructions into the page, and the victim's browser follows them as if TikTok had written them itself.

The program says the issue was fixed on 7 September 2022. The report was made public on 27 January 2023 and is rated high severity.

The researcher's own summary is one sentence:

I found a Cross-site scripting (XSS) and bypassed the WAF (akamai) on one of the TikTok ads endpoints and could lead it to takeover any account on ads.tiktok.com

Two things are being claimed here. First, a reflected XSS on an ads page. Second, a bypass of the WAF, short for web application firewall: a filter that sits in front of a website and blocks requests that look malicious, in this case Akamai's. The researcher says the WAF was bypassed.

The report does not name the page, the field that echoed the input back, the payload used, or how the firewall was avoided. There is no request or response to look at, no step-by-step reproduction, and no screenshots or videos.

The program describes the effect in cautious terms: a JavaScript payload injected into the page would run inside the victim's browser. JavaScript is the programming language browsers use to make pages interactive, and running attacker-supplied JavaScript in a victim's session is the core of XSS. The researcher goes further and says the flaw could be used to take over any account on ads.tiktok.com. The report does not show how that would be done, so the takeover claim is the researcher's assertion rather than a demonstrated result. No bounty amount is stated.

In general, how this kind of bug works

When you use a website, your browser sends a request and the server sends back a response, usually a page of HTML. HTML is the language that describes what a page contains: headings, links, forms, images. The browser reads it and draws the page.

Reflected XSS happens when a site copies something from your request straight into that response without escaping it. A simple comparison: imagine a form letter where the clerk types your name into a blank. If you write "please ignore the rest of this letter" instead of a name, and the clerk copies it word for word, the letter now contains an instruction the author never intended. Browsers are literal in the same way. If your input contains characters that HTML treats as markup, the browser builds part of the page from your text.

Because the injected script runs as part of the real site, it inherits the site's trust. It can read cookies (small pieces of data the site stores in your browser, often used to keep you logged in), call the site's own features on your behalf, and read what the page can read. That is why XSS is treated as serious rather than cosmetic.

Delivery matters. The attacker usually cannot edit the page directly; instead they send the victim a crafted link containing the payload, and the victim's own browser makes the request. This is why the bug is called reflected: the input bounces off the server and back into the victim's browser.

Defences come in layers:

  1. Output encoding at the point where the data is written into the page, chosen for the right context, is the real fix.
  2. A Content Security Policy, a set of rules telling the browser which scripts may run, limits the damage when encoding fails.
  3. Input validation and WAF rules cut down the number of attempts, but they are not a substitute for encoding, because filters can often be worked around. This report is an example: the researcher bypassed the Akamai WAF.

In general, how to test for it

  1. Find the inputs that end up in the response: values in the address bar, parts of the path, and form fields that are echoed back on error or confirmation pages.
  2. Send a harmless marker value and find every place it appears in the response.
  3. For each appearance, work out the context: between tags, inside an attribute, inside a quoted JavaScript string, inside a URL. The context decides which characters could break out.
  4. Send characters suited to that context and watch whether they are encoded, removed or passed through unchanged. A real finding is a response where your input changes the structure of the page, confirmed by the browser actually running your marker, not just by finding the text in the response.
  5. If a WAF blocks the obvious payload, vary the encoding, letter case, event handlers and tag choices, and check whether the block happens at the edge or inside the application.

Common false positives: the marker only appears in a safely encoded spot and cannot break out; the reflection sits in a JavaScript string that is itself escaped; the payload only fires because of browser extensions or developer settings; or the response is served with a content type that stops the browser treating it as HTML. Always confirm execution in a real browser before reporting.

In general, how it is fixed

Encode output where it is reflected, using a library that knows the target context (HTML, attribute, JavaScript, CSS, URL). For values with a known shape, prefer allow-list validation. Add a Content Security Policy that disallows inline script and restricts where scripts can load from. Mark session cookies HttpOnly and SameSite so that injected script cannot read them directly. Treat WAF rules as an extra layer and fix the underlying encoding gap.

In general, where to look

Reflected XSS tends to hide in search and filter fields, error and redirect messages, language and theme switches, and any field whose value is echoed into a page template. Advertising and business dashboards are productive targets because they combine many inputs with complex templates. Useful signals include values that appear verbatim in responses, pages that reflect input into JavaScript configuration blocks, and sites behind a WAF where simple payloads are blocked but the reflection itself is still unencoded. To make a report convincing, show the exact request and response, demonstrate execution in a current browser, and describe the concrete action an attacker could take in the victim's session, such as reading account data or changing a setting, rather than stopping at a pop-up box.

Glossary

  • XSS (cross-site scripting): a flaw where a site lets attacker-supplied code run in a victim's browser as part of the site itself.
  • Reflected XSS: XSS where the malicious input is sent in a request and echoed straight back in the response.
  • Endpoint: a specific address on a server that handles a particular kind of request.
  • Request: the message your browser sends to a server asking for a page or an action.
  • Response: the message the server sends back, usually HTML.
  • HTML: the language that describes the structure and content of a web page.
  • HTML escaping / output encoding: converting characters that a browser would treat as instructions into harmless text before writing them into a page.
  • JavaScript: the programming language browsers run to make pages interactive.
  • Payload: the piece of input an attacker sends to trigger a flaw.
  • WAF (web application firewall): a filter in front of a website that blocks requests that look malicious.
  • Akamai: the provider of the WAF in front of this endpoint, as named in the report.
  • Bypass: getting past a protection such as a filter without it stopping you.
  • Cookie: a small piece of data a site stores in your browser, often used to keep you logged in.
  • HttpOnly: a cookie setting that stops JavaScript from reading the cookie.
  • SameSite: a cookie setting that limits when the cookie is sent with requests from other sites.
  • Content Security Policy (CSP): rules telling the browser which scripts a page may run and from where.
  • Input validation: checking that supplied data matches an expected shape before using it.
  • Allow-list: a list of permitted values, where anything not on the list is rejected.
  • Context: the place in a page where data lands (between tags, in an attribute, in a script, in a URL), which decides how it must be encoded.
  • False positive: a result that looks like a vulnerability but is not actually exploitable.
  • Account takeover: gaining control of someone else's account.
  • Severity: a rating of how serious a flaw is; this report is rated high.

More by s3c

View all

3 more disclosed reports, best first.

More from TikTok

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.