BUG: MathObfuscation, NegationTrap, SelectiveText and Zalgo converter identifiers ignore settings that change output
Maintainer thường phản hồi trong vòng 2 ngày
Đá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
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: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
- 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
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackCó thể đã có người làm @u7k4rs6 đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/PyRIT#3095 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: LeetspeakConverter ignores uppercase and multi-character custom_substitutions keys and fails on empty replacement listsCó thể đã có người làm @ShivamSharma43 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: InsertPunctuationConverter accepts multi-character and empty punctuation_list entriesCó thể đã có người làm @ShivamSharma43 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: ColloquialWordswapConverter identifier ignores custom substitution valuesCó thể đã có người làm @ShivamSharma43 đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: CredentialLeakScorer misses OpenAI, Anthropic, and Hugging Face API keysCó thể đã có người làm @Kaap10 đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
bug Size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oposs/repo-infra#93 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Graphify-Labs/graphify#4546 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
521xueweihan/HelloGitHub#4025 ·