fix: adversary 跨仓重定位 env 间接化(zizmor high) - #101
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanges跨仓目标路径处理
Suggested labels: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoFix zizmor template-injection in adversary workflow via env indirection
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Misleading “no interpolation” comment
|
| # zizmor template-injection:表达式一律经 env 间接(XT_REPO_IN),正文零插值 | ||
| if [[ -n "${XT_REPO_IN:-}" ]]; then |
There was a problem hiding this comment.
1. Misleading “no interpolation” comment 🐞 Bug ⚙ Maintainability
The new comment claims the run body has “正文零插值”, but the script still contains a ${{
github.event_name }} template expansion in the run block, so the statement is false and can
re-trigger zizmor template-injection under stricter personas (e.g., pedantic). This mismatch
increases future maintenance risk and weakens the intended “no template in run” invariant.
Agent Prompt
### Issue description
A newly added comment states the `run:` body contains no `${{ }}` template expansions, but the script still uses `${{ github.event_name }}` inside the run block. This is misleading and can re-surface `template-injection` findings if zizmor is run in a stricter persona.
### Issue Context
This workflow already follows the pattern “template values via env, not interpolated in shell” elsewhere in the repo, and the comment suggests this step follows the same invariant.
### Fix Focus Areas
- .github/workflows/adversary.yml[108-122]
### Suggested change
1. Add an env var like `EVENT_NAME: ${{ github.event_name }}` in the step’s `env:`.
2. Replace `if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then` with `if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then`.
3. Either remove or reword the comment to match reality (e.g., “untrusted expressions are env-indirected”).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
PR#98 引入的 XT_REPO 行内插值触发 zizmor template-injection high(run 块内 ${{ }})。改 env 间接(XT_REPO_IN),语义零变化。CIW hygiene exit 14 实测暴露。
Summary by CodeRabbit
external-target/,路径校验行为不变。