BUG: MathObfuscation, NegationTrap, SelectiveText and Zalgo converter identifiers ignore settings that change output
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
Read the identifier implementations for MathObfuscationConverter, NegationTrapConverter, SelectiveTextConverter, and ZalgoConverter; compare them with seeded converters such as EmojiConverter. Use the reproduction pairs and ConverterRegistry registration shown in the issue to check the behavior. Done means differently configured instances have different identifiers and both NegationTrapConverter instances register successfully.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Four text converters leave settings that change their output out of their identifiers, so differently configured instances share one hash:
MathObfuscationConverter:hintandsuffix(onlymin_nandmax_nare included).NegationTrapConverter:wrong_valueandtrap_template. It does not override_build_identifier()at all, so its identifier only holds the supported input and output types.SelectiveTextConverter:word_separator, which word-level strategies split and rejoin on.ZalgoConverter:seed. Other seeded converters (EmojiConverter,CharSwapConverter,AskToDecodeConverter,RandomCapitalLettersConverter, ...) includeseed.
Because the default registry name comes from that hash, registering a second configuration without a custom name raises a duplicate-name error, and memory and analytics cannot tell the configurations apart. This is the same problem as #3242 and #3244, for these text converters.
Steps/Code to Reproduce
from pyrit.converter import (
Base64Converter,
MathObfuscationConverter,
NegationTrapConverter,
SelectiveTextConverter,
ZalgoConverter,
)
from pyrit.converter.text_selection_strategy import WordPositionSelectionStrategy
from pyrit.registry import ConverterRegistry
words = WordPositionSelectionStrategy(start_proportion=0, end_proportion=0.5)
pairs = [
(MathObfuscationConverter(hint="a"), MathObfuscationConverter(hint="")),
(MathObfuscationConverter(suffix="x"), MathObfuscationConverter(suffix="")),
(NegationTrapConverter(wrong_value="1234"), NegationTrapConverter(wrong_value="hunter2")),
(
NegationTrapConverter(trap_template="A {prompt} {wrong_value}"),
NegationTrapConverter(trap_template="B {prompt} {wrong_value}"),
),
(
SelectiveTextConverter(sub_converter=Base64Converter(), selection_strategy=words),
SelectiveTextConverter(sub_converter=Base64Converter(), selection_strategy=words, word_separator=","),
),
(ZalgoConverter(seed=1), ZalgoConverter(seed=2)),
]
for first, second in pairs:
print(first.get_identifier().unique_name, second.get_identifier().unique_name)
registry = ConverterRegistry()
registry.instances.register(NegationTrapConverter(wrong_value="1234"))
registry.instances.register(NegationTrapConverter(wrong_value="hunter2"))
Expected Results
Each pair has two different identifiers, and both NegationTrapConverter instances register.
Actual Results
MathObfuscationConverter::81c6f15b MathObfuscationConverter::81c6f15b
MathObfuscationConverter::81c6f15b MathObfuscationConverter::81c6f15b
NegationTrapConverter::89a3d225 NegationTrapConverter::89a3d225
NegationTrapConverter::89a3d225 NegationTrapConverter::89a3d225
SelectiveTextConverter::91a088c0 SelectiveTextConverter::91a088c0
ZalgoConverter::78d075f9 ZalgoConverter::78d075f9
ValueError: Instance 'NegationTrapConverter::89a3d225' already exists
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (5b594e00) in editable mode
- 主要言語
- Python
- スター
- 4.6k
- フォーク
- 962
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 354
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/PyRIT のほかの issue
-
BUG: label queries only return the final conversation of an attack対応中かも @u7k4rs6 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/PyRIT#3095 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
microsoft/PyRIT#3325 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 53/100
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 46/100
メンテナーはふだん 2 日以内に返信
-
BUG: Tone, Tense, Translation, Noise, ScientificTranslation and Variation converter identifiers ignore a custom prompt_template対応中かも @ShivamSharma43 が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
メンテナーはふだん 2 日以内に返信
microsoft/PyRIT の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
google-ai-edge/litert-torch#1346 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
geneontology/gocam-py#272 ·
-
pushed_authorization_request sends list authorization_details as a Python repr対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
auth0/auth0-python#903 ·
メンテナーはふだん 1 日以内に返信