Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Judge-supplied metadata can override the stored score value; extraction and rendering trust quoted JSON and unfenced role lines

未关闭
#3,323 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
46/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

Start with the scorer paths named in the issue: normalize_score_to_float, ConversationScorer, and the sibling metadata stripping in true_false_score_aggregator.py and true_false_inverter_scorer.py. Review the JSON handling precedent in decision_scorer.py and the existing retry boundary, then reproduce each reported case with mocked LLM transport. Done means quoted JSON and forged role lines cannot alter the verdict, and metadata cannot override the validated score.

由索引模型根据 Issue 内容生成。

描述

Judge-supplied metadata can override the stored score value; extraction and rendering trust quoted JSON and unfenced role lines

Summary

Three verdict-integrity defects in the scorer stack, each demonstrated end to end against real scorers (LLM transport mocked, everything else real):

  1. Metadata override (fixed in the companion PR): normalize_score_to_float prefers a judge-supplied original_float_value metadata key over the validated score_value. A raw float-scale scorer with a judge body of score_value: "0.0" + metadata: {"original_float_value": "1.0"} stores 0.0 while every consumer computes 1.0, and a 7.5 escapes [0,1]. TAP's success gate and Crescendo's feedback prompt consume the raw float.

  2. Earliest-JSON-wins extraction (fixed in the companion PR): a judge reply quoting a target-embedded JSON object before its own verdict has the decoy parsed as the verdict. Repro: judge authored score_value: false, persisted Score was True with the attacker's rationale verbatim. No injection needed. Eleven judge prompts instruct JSON but none forbid quoting, and the refusal prompts' few-shot rationales quote the reply.

  3. Transcript forgery (fixed in the companion PR): ConversationScorer's unfenced {role}: {text} rendering lets a target reply forge User:/Assistant: turns in the judge's view. Control refusal scored False. The same conversation with two embedded role lines scored True.

Context

The judged text is by design the adversary's output (the tool exists to grade hostile content), so the structural defenses (parse-time key strip, ambiguity rejection, turn fencing) carry the load that prompt-level instructions cannot. Each fix follows an in-repo precedent: the sibling metadata strips (true_false_score_aggregator.py:153, true_false_inverter_scorer.py:132), the decision scorer's JSON-encoding of target text (decision_scorer.py:208-236), and the existing retry boundary.

Repros available on request. Each is self-contained and exits 0 with the exploit confirmed at HEAD and blocked on the fix branches.

主要语言
Python
星标
4.6k
派生
962
平均合并
2 天 16 小时
30 天内合并 PR
354

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/PyRIT 的其他 Issue

查看 microsoft/PyRIT 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。