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.
Published on hamzadzworm.medium.com
after receiving an invite to site.com, a platform related to AI assistants, I performed thorough reconnaissance using:
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
- Discover the endpoint new?q= that creates a chat and searches for the given query.
- Notice that adding preview=true automatically shows a code preview without user interaction.
- Try to embed an iframe but encounter a CSP error because only trusted domains are allowed.
- Find that Stripe is a trusted domain by checking the site's payment page.
- Create a Stripe payment link and use it as the iframe source.
- 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.