Skip to content
XSS Disclosed report Intermediate

XSS vulnerability without a content security bypass in a `CUSTOM` App through Button tag

A custom Stripe app using the Button component with a javascript: href containing a newline character could execute script, but the dashboard's Content Security Policy blocked it. An attacker who could bypass CSP might achieve stored XSS in the Stripe dashboard.

Saajan Bhujel Follow

Originally disclosed on HackerOne

Bounty$2,000 Medium View original
  • Triaged in 35 hours
  • Fixed in 2 months
  • Paid in 35 hours
  • Disclosed after 4 months

Summary:

Hi security team members,

Hope you are well and doing great :)

I found a Possible XSS vulnerability in CUSTOM App through the Button tag but I was not able to bypass a content security policy.

This report is similar to my previous report(#1804177). The only difference is that the previous issue I found on a live Stripe App(which uses a Link tag maybe). But, here in this report "I found it possible to create an XSS vulnerability with the help of the Button tag".

Description:

This occurs when you create a CUSTOM app with the Button tag. Like:- <Button href="javascript://%0aalert(document.domain)">XSS</Button>

Steps To Reproduce:

  1. Create a demo Custom app through stripe-cli
  2. Replace your viewport with "viewport": "stripe.dashboard.drawer.default" in stripe-app.json, So the app works on every page in the dashboard
  3. Copy and paste the below code into your App.tsx file
import { Box, ContextView, Inline, Link } from "@stripe/ui-extension-sdk/ui";
import type { ExtensionContextValue } from "@stripe/ui-extension-sdk/context";
import {Button} from '@stripe/ui-extension-sdk/ui';
import {Img} from '@stripe/ui-extension-sdk/ui'
import {Chip, ChipList} from '@stripe/ui-extension-sdk/ui';

import BrandIcon from "./brand_icon.svg";

/**
 * This is a view that is rendered in the Stripe dashboard's customer detail page.
 * In stripe-app.json, this view is configured with stripe.dashboard.customer.detail viewport.
 * You can add a new view by running "stripe apps add view" from the CLI.
 */

const App = ({ userContext, environment }: ExtensionContextValue) => {
  return (
    <ContextView
      title="XSS POC"
      brandColor="#F6F8FA" // replace this with your brand color
      brandIcon={BrandIcon} // replace this with your brand icon
    >
	  
	  <Button href="javascript://%0aalert(123)">
		XSS with %0a
	  </Button>
	  <Button href="javascript://%0dalert(document.domain)">
		XSS with %0d
	  </Button>
	  
    </ContextView>
  );
};

export default App;
  1. Then, Run and Open your app
  2. Once you open your app then after click on the button link. It will doesn't execute because of CSP.
CSP.png
CSP.png From the original on HackerOne
  1. But, If you turn off your CSP protection with the help of an extension then XSS will execute.
XSS_when_csp_is_off.png
XSS_when_csp_is_off.png From the original on HackerOne

Video POC:

Video.webm From the original on HackerOne

Impact

If an attacker is able to bypass CSP then there is a possible stored XSS vulnerability in https://dashboard.stripe.com.

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

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

Likely the Button component did not sanitise or block javascript: URLs in its href attribute, allowing script execution when clicked.

Impact

If an attacker is able to bypass CSP then there is a possible stored XSS vulnerability in the Stripe dashboard; however, the report notes CSP blocked the exploit as tested.

What the attacker needed

Ability to create a custom Stripe app; victim clicks the button; CSP must be bypassed or disabled

How it was found

  1. Create a demo Custom app through stripe-cli
  2. Set the viewport to stripe.dashboard.drawer.default in stripe-app.json
  3. Put the provided code with Button href using javascript: into App.tsx
  4. Run and open the app
  5. Click the button link; it does not execute because of CSP
  6. Disable CSP with a browser extension and click again; the XSS executes

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.

A cross-site scripting (XSS) bug lets an attacker run their own JavaScript in another user's browser session. Here, a button's link could be set to a javascript: address, which runs code when clicked, but the site's Content Security Policy (a browser rule that blocks inline scripts) stopped it. Without that protection, the code would have run.

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 Saajan Bhujel

View all

3 more disclosed reports, best first.

More from Stripe

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.