Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#3,287 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@ShivamSharma43 đang làm issue này rồi.

Từ ngày 17/10/2026.

  • #3288 của @ShivamSharma43 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
4.6k
Fork
962
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
367

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.