[Security] 前端攻擊案例:差一點的 Figma XSS、Proton
This is a study-notes article summarising several real front-end vulnerability cases, including a DOM XSS in Figma that was blocked by CSP, a Proton Mail XSS chain that bypassed sanitisation, iframe sandbox and CSP, a Chrome Payment Request API flaw that allowed service worker registration on a file-hosting origin, a Bitrix24 client-side prototype pollution leading to XSS, and a Joomla! XSS caused by inconsistent PHP multibyte string handling. Each case explains what was wrong and what an attacker could achieve, such as reading a victim's emails or running code in the victim's browser.
承接上篇 (Security) 前端攻擊在 Web3 的應用、XSLeaks、XS-Search 與 Cache probing,此篇主要敘述的是《Beyond XSS:探索網頁前端資安宇宙》 6–1~6–5 章節的筆記,也是這系列最後一篇囉🎉,若有錯誤歡迎大家回覆告訴我~
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
Root cause
Likely each case stems from sanitising or transforming user-supplied markup in a way that changes how the browser later parses it, so unsafe markup survives the filter.
What the attacker needed
Victim opens a crafted email; attacker can send email to victim; victim uses Proton Mail web app
The fix
Proton Mail should not swap the outer element after sanitisation in a way that changes parsing, and the article notes the sandbox and CSP layers were also part of the defence.
How it was found
- Send the victim an email containing a style block and attribute selectors that leak the blob URL of an uploaded attachment back to the attacker's server.
- Once the blob URL is known, send a second email containing a script tag pointing at that blob URL, using the sanitiser bypass so the script survives.
- When the victim opens the second email, the script loads the blob and the attacker's JavaScript runs in the mail origin.
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.
These are notes about several real bugs found in well-known websites and browsers. In each case a website took text from a user and put it on a page without cleaning it properly, so an attacker could sneak in code that runs in another person's browser. The notes also show how extra protections such as content security policy or sandboxed frames sometimes stopped the attack and sometimes were bypassed.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.