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

BUG: MathObfuscation, NegationTrap, SelectiveText and Zalgo converter identifiers ignore settings that change output

クローズ
#3,287 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

2026年10月18日 から。

  • #3288 @ShivamSharma43 による — マージ済み

評価

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

調査の方向性

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: hint and suffix (only min_n and max_n are included).
  • NegationTrapConverter: wrong_value and trap_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, ...) include seed.

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

環境構築

Codespaces で開く

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

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

はじめの一歩

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

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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