Repository navigation
fix(app-control): write affected.json fresh, never through a link - #13838
Conversation
…d let the capture run it Capture run 42292050330 drove nothing: run-e2e needs drive's Affected step and the leg could not run affected_features.py. The script now removes any link at its affected.json and creates the file with O_EXCL|O_NOFOLLOW, so a link planted by a pull request's head or its sandbox cannot redirect the write. The capture's python3 -I rule for main's copy comes back. Refs: #13710 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z
…write Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
claude-review reviewed Code review: PR #13838, write
|
|
claude-security-review reviewed Security review: PR #13838, no security issues foundThis is the first review of this PR ( What changed. What I checked:
critical-findings: 0 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z
Refs: #13710
Summary
Capture run 42292050330, the first after PR 13825, drove nothing. Its summary says:
"affected blocked: affected_features.py could not run (permission for the command was denied in this unattended session); no entry point driven". run-e2e finds what to drive through drive's Affected step (plugins/testing/skills/run-e2e/SKILL.md:86), so with that script refused the capture never launches the app.PR 13825 dropped the capture's
python3 -Irule after claude-security-review found that the script'sopen(<out>/affected.json, "w")follows a link a pull request's head or its sandbox can plant, redirecting the write into a.basescript the leg may run (thread). This PR removes that route in the script itself, then restores the rule.Fix
plugins/app-control/scripts/affected_features.py: before the write, any entry ataffected.jsonis unlinked, which removes a link and never its target. The file is then created withO_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW. A link planted again between the two calls makesO_EXCLfail, so the step reportsblockedand writes nothing..github/workflows/pr-verify-capture.yml:Bash(python3 -I ${{ github.workspace }}/.base/plugins/app-control/scripts/affected_features.py *)is back, main's copy only, by absolute path. The Bash-fence comment says why it is safe..basescripts from root-owned copies, is not taken. The routes it guards are already closed:.base: the absoluteEdit(/${{ github.workspace }}/.base/**)deny rule, and the probe's write-link check..baseread-only, so it cannot write it either.capture-runinto.basefails, since they are separate bind mounts. link(2), EXDEV: "link() does not work across different mounts, even if the same filesystem is mounted on both".Verification
bash plugins/app-control/scripts/affected_features.test.sh: all passed. It has a new case each for a symbolic and a hard link left ataffected.json: the link is replaced and its target is unchanged. On main's script, both new cases fail.node --test .github/scripts/pr-verify/workflow.test.mjs: 80 passed. The absolutepython3 -Iform is allowed; forms without-I, a relative path and the head's copy stay refused.scripts/check-affected.sh --tests: 15 passed, 94 skipped.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01RMa441b9qec43NvaTyiY2Z