Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG: XSSOutputScorer misses SVG and JavaScript data URIs

オープン
#3,399 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@Kaap10 がすでに取り組んでいます。

2026年10月20日 から。

  • #3400 @Kaap10 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
ai, security

調査の方向性

Find the XSSOutputScorer implementation and its tests; the issue does not name their paths. Start by tracing the existing data:text/html URI patterns and the reproductions in the issue. Done when SVG and JavaScript data URIs score True in both cases described; linked pull request #3400 is already open.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

XSSOutputScorer detects cross-site scripting (XSS) payloads in LLM responses (mapping to OWASP LLM02: Insecure Output Handling). While it detects inline <script>, event handlers, and data:text/html URIs, its data URI patterns are hardcoded exclusively to text/html:

  1. SVG Data URIs (data:image/svg+xml):
    SVG markup can execute arbitrary JavaScript via embedded <script> tags or event handlers (onload=alert(1)). When embedded in markdown images (![alt](data:image/svg+xml,<svg onload=alert(1)>)), HTML <img src="data:image/svg+xml;base64,...">, or <object data="data:image/svg+xml,...">, these zero-click vectors score as False.

  2. JavaScript Data URIs (data:text/javascript, data:application/javascript):
    Direct script execution via data URIs (e.g. <script src="data:text/javascript,alert(1)"> or markdown links [click](data:text/javascript,...)) bypasses data:text/html and scores as False.

Steps/Code to Reproduce
import asyncio
from pyrit.score import XSSOutputScorer

async def main():
    scorer = XSSOutputScorer()

    # SVG data URI with onload:
    score1 = (await scorer.score_text_async('<img src="data:image/svg+xml;base64,PHN2ZyBvbmxvYWQ9YWxlcnQoMSk+">'))[0]
    print("SVG data URI detected:", score1.get_value())

    # Script data URI:
    score2 = (await scorer.score_text_async('<script src="data:text/javascript,alert(1)"></script>'))[0]
    print("Script data URI detected:", score2.get_value())

asyncio.run(main())
Expected Results

Both XSS data URIs should be recognized as executable content and score as True.

Actual Results

Both payloads score as False.

主要言語
Python
スター
4.6k
フォーク
962
平均マージ
2日 15時間
マージ済み PR(30日)
398

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。