Skip to content
XSS Write-up Intermediate

Exploiting Automatic code preview Lead For Critical stored iframe

The AI assistant's automatic code preview feature allowed an attacker to inject a stored iframe into a chat session. Because the site's content security policy trusted Stripe, the attacker could embed a Stripe payment page inside the iframe, tricking victims into paying the attacker.

Abdelkader Mouaz Follow

Published on hamzadzworm.medium.com

after receiving an invite to site.com, a platform related to AI assistants, I performed thorough reconnaissance using:

Hamzadzworm, on hamzadzworm.medium.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could store a chat containing a full-page iframe that loads a Stripe payment page, tricking victims into paying the attacker; the CSP limited which domains could be framed but did not prevent the attack because Stripe was trusted.

What the attacker needed

Victim clicks a link; attacker has a Stripe account

How it was found

  1. Discover the endpoint new?q= that creates a chat and searches for the given query.
  2. Notice that adding preview=true automatically shows a code preview without user interaction.
  3. Try to embed an iframe but encounter a CSP error because only trusted domains are allowed.
  4. Find that Stripe is a trusted domain by checking the site's payment page.
  5. Create a Stripe payment link and use it as the iframe source.
  6. Craft a stored payload that sets the chat title and injects a full-page iframe pointing to the Stripe payment link.

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 write-up has not been written yet. The Original tab links to the source.

A content security policy (CSP) is a rule that tells the browser which websites it is allowed to load content from. Here, the site trusted Stripe, a payment service, so the attacker could put a Stripe payment page inside an iframe (a window within a page) and make it look like part of the site. When a victim opened the chat, they saw a fake payment page and could be tricked into paying the attacker.

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 Abdelkader Mouaz

View all

6 more disclosed reports, best first.

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.