Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

BUG: ColloquialWordswapConverter identifier ignores custom substitution values

Chiusa
#3,289 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@ShivamSharma43 ci sta già lavorando.

Dal 18/10/2026.

  • #3290 di @ShivamSharma43 — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
security

Direzione di ricerca

Read ColloquialWordswapConverter's identifier construction and compare it with LeetspeakConverter, which the issue identifies as handling full custom mappings. Check how the converter's identifier is tested; done means configurations with identical keys but different substitution values have different identifiers and both can register. A linked open pull request indicates this work is already underway.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

ColloquialWordswapConverter identifies custom_substitutions only by their keys (substitution_keys). Two converters whose custom dictionaries have the same words but different substitutions produce different output but share one hash.

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. LeetspeakConverter already handles the same case by adding a custom_substitutions_hash of the full mapping. This is the same kind of problem as #3242 and #3244.

Steps/Code to Reproduce
import asyncio

from pyrit.converter import ColloquialWordswapConverter
from pyrit.registry import ConverterRegistry

papa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["papa"]})
bapa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["bapa"]})
print(papa.get_identifier().unique_name, bapa.get_identifier().unique_name)
print(asyncio.run(papa.convert_async(prompt="my father")).output_text)
print(asyncio.run(bapa.convert_async(prompt="my father")).output_text)

registry = ConverterRegistry()
registry.instances.register(papa)
registry.instances.register(bapa)
Expected Results

The two converters have different identifiers, and both register.

Actual Results
ColloquialWordswapConverter::ab18d07b ColloquialWordswapConverter::ab18d07b
my papa
my bapa
ValueError: Instance 'ColloquialWordswapConverter::ab18d07b' already exists
Screenshots

N/A

Versions
  • OS: Windows 11
  • Python version: 3.11.9
  • PyRIT version: installed from main (5b594e00) in editable mode
Lingua principale
Python
Stelle
4.6k
Fork
962
Merge medio
2g 15h
PR unite (30g)
390

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/PyRIT

Tutte le issue di microsoft/PyRIT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.