Skip to content

v2.0.3 — 参数引号加固 + submit_flag 命令注入修复

Latest

Choose a tag to compare

@hack-umbrella hack-umbrella released this 29 Oct 09:07

两处修复:工具参数引号加固(治上次那轮失败)+ pentest_submit_flag 命令注入。

1. 模型在参数里写裸双引号 → 整轮 MALFORMED_RESPONSE

宿主在流结束时直接 JSON.parse 每个 tool-call 的 arguments,一个块坏了整步报错,参数根本到不了插件层——所以只能在提示词侧降低概率、缩小影响面:

  • persona(agent.cordis.yml / agent.cordis.next.yml 两代变体)新增参数编码纪律:字符串参数里不写裸 ASCII 双引号,中文引用用「」,命令/PoC 用单引号;
  • pentest-report / pentest-exploit 技能同步这条硬性要求,并限定一步只记一条 finding——同一步的多个 tool-call 是「一坏全废」,拆开可限制损失。

2. pentest_submit_flag 命令注入

原先 "http://" + server + "/api/submit" 裸插值:模型(或被测目标上的提示注入)给出带引号 / $(...) 的字符串就能在宿主执行任意命令。改为白名单校验(host[:port] / token 字符集)+ q() 转义;未传参时仍走 $TSEC_* 环境变量回退(该路径由 shell 展开,不经拼接)。

验证

  • node --check lib/pentest-tools.js
  • js-yaml 校验 3 份 yml
  • npm test:13 通过,1 跳过
  • 注入用例(token 带 "; touch /tmp/pwned; echo "、server 带 $(id))均被拒,正常调用与环境变量回退不受影响
  • node scripts/release-check.mjs:31/31

升级

gh release download v2.0.3 --repo hack-umbrella/pipadeep -p '*.tgz' -D ~/.dsh/pkgs
dsh plugin --profile web add file:~/.dsh/pkgs/pipadeep-dsh-pentest-2.0.3.tgz