Cross-site scripting through SVG creation #483
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-177
grade-b
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/TicketRenderer.sol#L33-L48
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/ReceiptRenderer.sol#L100-L115
Vulnerability details
Impact
XSS attacks will be present when SVG is loaded.
Proof of Concept
Cross-site scripting attacks, also called XSS attacks, are a type of injection attack that injects malicious code into otherwise safe websites. If a malicious user is able to inject malicious Javascript into a SVG file, then any user who views the SVG on a website will be susceptible to XSS. This can lead stolen cookies, Denial of Service attacks, and more. When generating the ERC721 receipt, the malicious user can set malicious XSS into the tokenId or questId. When SVG is loaded on any site, any user viewing the SVG will load the malicious Javascript as well from within the SVG and result in XSS attack.
}
https://research.securitum.com/do-you-allow-to-load-svg-files-you-have-xss/
Reference: code-423n4/2022-01-timeswap-findings#131
Tools Used
Manual Review
Recommended Mitigation Steps
Don't generate the svg or remove all user-input data from the svg file.
The text was updated successfully, but these errors were encountered: