Scenario objective previews can split supplementary Unicode during truncation

オープン 初心者向け
#3,870 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@Aadithya-kl がすでに取り組んでいます。

2026年11月3日 から。

  • #3890 @Aadithya-kl による — オープン

評価

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

調査の方向性

まず objectivePreview ヘルパーから始めてください。このヘルパーは UTF-16 のコード単位で切り詰めています。そこで切断位置を確認し、指定のリビジョンで集中テスト attackAttemptFormatting を実行して、インデックス 94 にある単独の上位サロゲートを確認してください。完了条件は、プレビューが対になっていないサロゲートで終わらないこと、94 個の a のケースで省略記号が表示されること、そして完全な絵文字の対照ケースが引き続き通ることです。

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

説明

Bug: triage help wanted
Describe the bug

objectivePreview truncates JavaScript strings by UTF-16 code unit. If the boundary falls between the two code units of a supplementary Unicode character, the preview contains an unpaired surrogate. The scenario run table renders the corrupted preview. This is presentation-only; the test does not show that stored objectives are changed.

Steps/Code to Reproduce
const objective = `${'a'.repeat(94)}😀 trailing text`
const preview = objectivePreview(objective, 'seed-boundary')

Run the focused attackAttemptFormatting test at revision 01ce6ca66a315770b36c7dca1f320668c0d92d7c.

Expected Results

Truncate without splitting a Unicode scalar, for example 94 a characters followed by an ellipsis. No lone surrogate should appear in the preview.

Actual Results

The helper returns a string whose code unit at index 94 is 0xD83D, an unmatched high surrogate. JSON serialization shows \ud83d…; Jest renders it as �. A complete-emoji boundary control passes.

Screenshots

N/A. The exact returned string and code unit are asserted in the focused test.

Versions

Linux; Node 26.12.1; npm 11.20.0; Jest 30.5.2; frontend at revision 01ce6ca66a315770b36c7dca1f320668c0d92d7c. Pure TypeScript Jest run; no browser or backend.

主要言語
Python
スター
4.7k
フォーク
1k
平均マージ
2日 3時間
マージ済み PR(30日)
450

環境構築

Codespaces で開く

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

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

はじめの一歩

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

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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