Summary
Improper handling of user input when loading a saved custom text results in XSS.
Details
The problem is in this part of the code in modes-notice.ts:
const customTextName = CustomTextState.getCustomTextName();
const isLong = CustomTextState.isCustomTextLong();
if (Config.mode === "custom" && customTextName !== "" && isLong) {
$(".pageTest #testModesNotice").append(
`<div class="textButton noInteraction"><i class="fas fa-book"></i>${customTextName} (shift + enter to save progress)</div>`
);
}
Specifically, this line:
<div class="textButton noInteraction"><i class="fas fa-book"></i>${customTextName} (shift + enter to save progress)</div>
customTextName is user input, and we're inserting it right into the div. Note that we need isLong to be true.
PoC
- Go to custom mode
- Click the save button
- Enter as the name a payload (say "img src=x onerror=alert(1)")
- Enable
Long text
- Save it
- After you click on ok, the payload will execute
Impact
This isn't a big vuln, as it only affects the person who created the custom text.
Screenshots
Summary
Improper handling of user input when loading a saved custom text results in XSS.
Details
The problem is in this part of the code in
modes-notice.ts:Specifically, this line:
<div class="textButton noInteraction"><i class="fas fa-book"></i>${customTextName} (shift + enter to save progress)</div>customTextNameis user input, and we're inserting it right into the div. Note that we needisLongto be true.PoC
Long textImpact
This isn't a big vuln, as it only affects the person who created the custom text.
Screenshots