BUG: LeetspeakConverter ignores uppercase and multi-character custom_substitutions keys and fails on empty replacement lists
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
Línea de trabajo
Read LeetspeakConverter and its convert_word_async method, then run the reproduction in the issue for uppercase, multi-character, and empty-list substitutions. Done means valid mappings produce the expected output and mappings that cannot be applied raise ValueError at construction; a linked pull request is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
LeetspeakConverter does not validate custom_substitutions, and convert_word_async looks each character up as char.lower(). As a result:
- An uppercase key such as
{"A": ["4"]}never matches, so the substitution is silently ignored, for both uppercase and lowercase letters in the prompt. - A multi-character key such as
{"th": ["7"]}never matches either, because the prompt is substituted one character at a time. - An empty replacement list such as
{"e": []}is accepted, then fails on the first matching character withIndexError: list index out of range(deterministic mode) orIndexError: Cannot choose from an empty sequence(random mode).
The defaults use lowercase single-character keys, so only custom substitutions are affected.
Steps/Code to Reproduce
import asyncio
from pyrit.converter import LeetspeakConverter
async def main():
for custom_substitutions in ({"A": ["4"], "T": ["7"]}, {"th": ["7"]}, {"e": []}):
converter = LeetspeakConverter(custom_substitutions=custom_substitutions)
try:
result = await converter.convert_async(prompt="Let that be")
print(custom_substitutions, repr(result.output_text))
except Exception as e:
print(custom_substitutions, f"{type(e).__name__}: {e}")
asyncio.run(main())
Expected Results
{"A": ["4"], "T": ["7"]} converts Let that be to Le7 7h47 be, and the other two raise ValueError when the converter is created, since those mappings can never be applied.
Actual Results
{'A': ['4'], 'T': ['7']} 'Let that be'
{'th': ['7']} 'Let that be'
{'e': []} IndexError: list index out of range
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (5b594e00) in editable mode
- Lenguaje dominante
- Python
- Estrellas
- 4.6k
- Forks
- 944
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 369
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackPosiblemente ocupada @u7k4rs6 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
microsoft/PyRIT#3095 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
BUG: InsertPunctuationConverter accepts multi-character and empty punctuation_list entriesPosiblemente ocupada @ShivamSharma43 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
BUG: ColloquialWordswapConverter identifier ignores custom substitution valuesPosiblemente ocupada @ShivamSharma43 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
BUG: MathObfuscation, NegationTrap, SelectiveText and Zalgo converter identifiers ignore settings that change outputPosiblemente ocupada @ShivamSharma43 la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
BUG: CredentialLeakScorer misses OpenAI, Anthropic, and Hugging Face API keysPosiblemente ocupada @Kaap10 la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/PyRIT
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
infrastructure qa
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
khuisman/mcp-gee-sweet#1068 ·
Los mantenedores suelen responder en 1 día
-
The book has a Nix install section that chelis.ch lacks, and it names two of the three systemsAbiertoarea:ecosystem documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Chelis-Lang/chelis#3866 ·
Los mantenedores suelen responder en 1 día
-
`lvm_compact` has no self-hosted twin, and `docs/158` §5 says every language-face component mustAbiertobug sev-3 vm
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
issue: Picking a prompt from the / menu in a channel inserts a command chip instead of the promptAbiertobug confirmed issue
Dificultad 2/5 Medio día Aptitud para principiantes 78/100
open-webui/open-webui#32712 · 2 comentarios ·
Los mantenedores suelen responder en 1 día