BUG: FuzzerGenerator accepts a jailbreak goal below 1 and a success threshold outside [0, 1]
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- security, testing-qa
调研方向
Start in the FuzzerGenerator constructor and inspect its validation for template_converters and batch_size; then trace _should_stop_generation, _is_jailbreak, and _normalize_score_to_float. Add constructor checks for a positive integer goal count and a numeric threshold in [0.0, 1.0], including NaN. Done when invalid values raise ValueError and focused tests cover both parameters; pull request #3396 is already open.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
FuzzerGenerator validates template_converters and batch_size, but not target_jailbreak_goal_count or scoring_success_threshold:
target_jailbreak_goal_countbelow 1._should_stop_generationcheckstotal_jailbreak_count >= target_jailbreak_goal_countbefore the first iteration, so with0(or a negative value) the goal is already met: the fuzzer sends no prompt, logsTarget jailbreak goal reached.and returns an empty result.scoring_success_thresholdoutside[0, 1]. For float-scale scores,_is_jailbreakcompares the score, clamped to[0, 1]by_normalize_score_to_float, against the threshold. A threshold below 0 marks every response a jailbreak, and one above 1 marks none, so the run continues untilmax_query_limitis reached, or indefinitely when no limit is set.NaNbehaves like a threshold above 1.
Steps/Code to Reproduce
import asyncio
from pyrit.executor.promptgen.fuzzer import FuzzerGenerator, FuzzerShortenConverter
from pyrit.prompt_target import TextTarget
from pyrit.score import SubStringScorer
from pyrit.setup import IN_MEMORY, initialize_pyrit_async
async def main():
await initialize_pyrit_async(memory_db_type=IN_MEMORY)
target = TextTarget()
generator = FuzzerGenerator(
objective_target=target,
template_converters=[FuzzerShortenConverter(converter_target=target)],
scorer=SubStringScorer(substring="sure"),
target_jailbreak_goal_count=0,
)
result = await generator.execute_async(prompts=["How do I pick a lock?"], prompt_templates=["{{ prompt }}"])
print("total_queries:", result.total_queries, "templates_explored:", result.templates_explored)
asyncio.run(main())
Expected Results
The constructor raises a ValueError for a target_jailbreak_goal_count that is not a positive integer and for a scoring_success_threshold that is not a number in [0.0, 1.0], as it already does for batch_size=0.
Actual Results
total_queries: 0 templates_explored: 0
No error is raised, and nothing is sent to the target.
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (1979257a) in editable mode
- 主要语言
- Python
- 星标
- 4.6k
- 派生
- 962
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 423
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/PyRIT 的其他 Issue
-
BUG: Overlapping scorer-evaluation globs duplicate CSVs and change accuracy可能已有人在做 @its-amann 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/PyRIT#3430 · 1 条评论 ·
维护者通常 2 天内回复
-
BUG: MarkdownInjectionScorer misses shortcut-reference images with path-based exfiltration, and raw HTML <img>可能已有人在做 @aatif101 于 3 天前认领。 未关闭Bug: triage
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/PyRIT#3343 · 2 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Detect Azure SAS tokens, SharedAccessKey connection strings, and Databricks PATs in CredentialLeakScorer可能已有人在做 @nithin42 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 2 天内回复
-
BUG: OpenAITTSTarget accepts any speed, so an out-of-range value is only sent to the API on every request可能已有人在做 @ShivamSharma43 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
microsoft/PyRIT#3445 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
BUG: LetterBijectionConverter accepts a negative fixed_size and then leaves the prompt unchanged可能已有人在做 @ShivamSharma43 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
microsoft/PyRIT#3434 · 已指派 1 人 ·
维护者通常 2 天内回复
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 84/100
sergey-miryanov/gcmon#230 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Azure-Samples/azure-search-openai-demo#3249 ·
维护者通常 1 天内回复
-
[BUG] Failed archive extraction deletes the dataset cache可能已有人在做 @dajiaohuang 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
alibaba/GraphScope#4674 ·