BUG: case insensitive keyword selection returns a shifted range when lowercasing expands a character
メンテナーはふだん 2 日以内に返信
@ManoharPaturi がすでに取り組んでいます。
2026年10月27日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
issueで言及されている KeywordSelectionStrategy.select_range を見つけ、大文字と小文字を区別しない一致を元のテキスト上の位置にどう対応付けているか調べてください。keyword="secret" と text="İsecret" で再現してください。小文字化による文字列の展開があっても、返された範囲で元のテキストからキーワード全体を切り出せれば完了です。payloadにはテストファイルの指定がないため、この再現ケースのテストを探すか追加してください。
索引モデルが issue の本文から書いたものです。
説明
Description
KeywordSelectionStrategy.select_range locates the keyword with text.lower().find(keyword.lower()) in case insensitive mode and then applies that index to the original, unlowered text. str.lower() is not length preserving for every character: a dotted capital I (İ, U+0130) lowercases to two code points, so every such character before the match shifts the returned range.
With keyword="secret" and case_sensitive=False on the text İsecret, the strategy returns the range (2, 7), which slices to ecret: the leading s of the keyword is left out. A SelectiveTextConverter built on this strategy then converts the wrong characters and the actual secret stays in the clear.
Expected Behavior
The selected range must slice to the keyword (plus any requested context) on the original text, whatever lowercase expansion occurs earlier in the string.
Reproduction Steps
- Build
KeywordSelectionStrategy(keyword="secret", case_sensitive=False). - Call
select_range(text="İsecret"). - The returned range slices to
ecreton main.
Minimal Reproduction
strategy = KeywordSelectionStrategy(keyword="secret", case_sensitive=False)
start, end = strategy.select_range(text="İsecret")
"İsecret"[start:end] # "ecret" on main
Environment
PyRIT main. Python 3.11.
- 主要言語
- Python
- スター
- 4.7k
- フォーク
- 980
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 446
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/PyRIT のほかの issue
-
BUG: Garak and ML-VLSU loaders still load one example when max_examples is 0 or negative対応中かも @ShivamSharma43 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
BUG: ComicJailbreak max_examples counts goals that render nothing, so templates=["code"] with max_examples=10 fails対応中かも @ShivamSharma43 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
BUG: SeedDatasetFilter matches harm_categories, modalities and size case-sensitively, unlike tags対応中かも @ShivamSharma43 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
Conversation drawer shows the previous attack's conversations after switching attacks対応中かも @ManoharPaturi が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/PyRIT#3575 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Conversation draft turns permanently dirty when applied conversions match no piece対応中かも @ManoharPaturi が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
microsoft/PyRIT#3573 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
microsoft/PyRIT の issue をすべて見る
似ている issue
-
app: scripts status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
netbox-community/netbox-scripts#68 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
marin-community/marin#10765 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
flathub/com.unity.UnityHub#230 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
EclipseFdn/open-vsx.org#14910 ·
メンテナーはふだん 1 日以内に返信