Skip to content
XSS Write-up Beginner

前端靜態掃描歷險記

A legacy jQuery project was flagged by a static scanner for many XSS risks because it inserted strings and API-returned HTML into the DOM with methods such as append and html. An attacker could inject script through user input or backend HTML and have it run in a victim's browser.

medium.com

Published on medium.com

手邊的 next.js 專案接近收尾,經過靜� �掃描也沒有出現大問題,正打算開始� �活人生的我,卻收到另一個古老的專案� 滿� 燈的掃描報告。� �中最多最嚴重的,便屬跨站攻擊 Cross-Site Scripting (XSS)。

廖偉帆, on 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

What the attacker needed

Legacy jQuery project; untrusted input reaches a DOM sink; victim views the affected page

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.

Cross-site scripting (XSS) is when a website takes text from a user or another system and puts it into the page in a way that the browser treats as code, so an attacker's script runs for other visitors. Here the old jQuery code inserted such text as real HTML instead of plain text, which allowed that. The fix was to insert plain text safely and to clean HTML before adding it.

What is XSS?

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

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.