BUG: case insensitive keyword selection returns a shifted range when lowercasing expands a character
Los mantenedores suelen responder en 2 días
@ManoharPaturi ya está trabajando en esto.
Desde el 27/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
Busca KeywordSelectionStrategy.select_range, mencionado en el issue, e inspecciona cómo devuelve una coincidencia sin distinguir mayúsculas de minúsculas a su posición en el texto original. Reproduce el caso con keyword="secret" y text="İsecret"; se considera terminado cuando el rango devuelto abarca la palabra clave completa en el texto original, a pesar de la expansión al pasar a minúsculas. El payload no indica ningún archivo de pruebas, así que localiza o añade cobertura para esta reproducción.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
KeywordSelectionStrategy.select_range locates the keyword with text.lower().find(keyword.lower()) in case insensitive mode and then applies that index to the original, unlowered text. str.lower() is not length preserving for every character: a dotted capital I (İ, U+0130) lowercases to two code points, so every such character before the match shifts the returned range.
With keyword="secret" and case_sensitive=False on the text İsecret, the strategy returns the range (2, 7), which slices to ecret: the leading s of the keyword is left out. A SelectiveTextConverter built on this strategy then converts the wrong characters and the actual secret stays in the clear.
Expected Behavior
The selected range must slice to the keyword (plus any requested context) on the original text, whatever lowercase expansion occurs earlier in the string.
Reproduction Steps
- Build
KeywordSelectionStrategy(keyword="secret", case_sensitive=False). - Call
select_range(text="İsecret"). - The returned range slices to
ecreton main.
Minimal Reproduction
strategy = KeywordSelectionStrategy(keyword="secret", case_sensitive=False)
start, end = strategy.select_range(text="İsecret")
"İsecret"[start:end] # "ecret" on main
Environment
PyRIT main. Python 3.11.
- Lenguaje dominante
- Python
- Estrellas
- 4.7k
- Forks
- 980
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 446
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: Garak and ML-VLSU loaders still load one example when max_examples is 0 or negativePosiblemente ocupada @ShivamSharma43 la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
BUG: ComicJailbreak max_examples counts goals that render nothing, so templates=["code"] with max_examples=10 failsPosiblemente ocupada @ShivamSharma43 la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
BUG: SeedDatasetFilter matches harm_categories, modalities and size case-sensitively, unlike tagsPosiblemente ocupada @ShivamSharma43 la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
Conversation drawer shows the previous attack's conversations after switching attacksPosiblemente ocupada @ManoharPaturi la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/PyRIT#3575 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Conversation draft turns permanently dirty when applied conversions match no piecePosiblemente ocupada @ManoharPaturi la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
microsoft/PyRIT#3573 · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/PyRIT
Issues similares
-
Context/namespace resources fail in-cluster: "Invalid kube-config file. No configuration found."Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
awslabs/visual-asset-management-system#880 ·
Los mantenedores suelen responder en 1 día
-
netbox status: needs owner type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
netbox-community/netbox#23533 ·
Los mantenedores suelen responder en 1 día
-
app: scripts status: backlog type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
netbox-community/netbox-scripts#68 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
marin-community/marin#10765 ·
Los mantenedores suelen responder en 1 día