Skip to content
XSS Advisory Intermediate

GHSL-2023-258_GHSL-2023-259: Reflected XSS vulnerability and CORS issue in tamagui

The tamagui website had a reflected XSS and open redirect via the redirect_to parameter, and a CORS misconfiguration that allowed any origin ending with tamagui.dev, localhost:1421, or stripe.com to make credentialed requests. An attacker could steal cookies and impersonate users.

Kwstubbs Follow

Originally disclosed on GitHub Security Lab

A reflected XSS vulnerability and a CORS issue are present on the tamagui website, tamagui.dev. These vulnerabilities may allow an attacker to leak the cookies of users, and thus impersonate users on the website.

Kwstubbs, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The redirect_to query parameter was passed directly to router.replace without validation, and the CORS origin check used endsWith instead of an exact match.

Impact

An attacker could steal user cookies and impersonate users, and could also redirect users to arbitrary domains; the CORS issue could lead to information disclosure.

What the attacker needed

Victim clicks a crafted link; victim signs in via GitHub; attacker controls a domain ending with an allowed string

The fix

The vulnerabilities were fixed by the maintainer.

How it was found

  1. An attacker crafts a tamagui link with a malicious redirect_to value.
  2. The victim clicks the link and is prompted to sign in via GitHub.
  3. After sign-in, the redirect_to value is used in router.replace, executing the attacker's script or redirecting to an attacker domain.
  4. For the CORS issue, the attacker hosts a malicious site whose origin ends with an allowed domain.
  5. The logged-in victim visits the malicious site, which makes credentialed requests to tamagui APIs and reads the responses.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Cross-site scripting (XSS) lets an attacker run their own JavaScript in a victim's browser on a trusted site, which can steal cookies. CORS is a browser rule that controls which other websites can read responses from a site; a misconfiguration can let a malicious site read sensitive data. Here, a login redirect parameter and a loose origin check both let an attacker act as the victim.

What is XSS?

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

More by Kwstubbs

View all

43 more disclosed reports, best first.

More from GitHub Security Lab

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.