nyx/tests/dynamic_fixtures/python/xss_positive.py

12 lines
323 B
Python
Raw Permalink Normal View History

2026-06-05 10:16:30 -05:00
"""XSS — positive fixture.
Vulnerable function: echoes user input directly into HTML without escaping.
Expected verdict: Confirmed (XSS payload echoed verbatim to output).
"""
def render_comment(user_input):
"""Vulnerable: no HTML escaping."""
html = f"<div class='comment'>{user_input}</div>"
print(html)