Commit c07ea76
committed
Dismiss CodeQL #14 with documented rationale + guard test
CodeQL alert #14 (untrusted-checkout-toctou/critical) is the third
re-fire of the same rule family on this workflow (#11/#12 → #13 → #14).
PR #427's fork-skip gate was load-bearing for #11/#12 but the rule
re-classified as #14 at a shifted line range with escalated severity.
A structural fix (checkout BASE_SHA only; `git show` for PR-head reads)
would close the rule cleanly but degrade reviewer quality: pr_review.md
explicitly instructs Codex to `grep -n "pattern" diff_diff/*.py` for
pattern-consistency checks, and Codex's `sandbox: read-only` lets it
inspect workspace files. Under restructure, those operations would
search BASE content, missing patterns added in the PR.
Workarounds that materialize PR-head content via non-`actions/checkout`
mechanisms (git worktree, overlay) satisfy CodeQL's pattern matcher
without changing runtime risk — security theater dressed up.
The honest path: dismiss with documented rationale + guard test.
The actual threat model accepted by the dismissal:
- Codex runs with sandbox: read-only — can read PR-head files, cannot
execute or write them
- head_sha is API-pinned in the resolve-pr step before checkout; TOCTOU
window is sub-second and bounded by the is_fork gate
- Same-repo PR contributors who can push to PR head branches already
have write access to push to main; the checkout doesn't expand
attack surface
- Fork PRs are skipped entirely (PR #427 fork-skip gate)
The dismissal becomes invalid only if a future workflow edit adds a
step that EXECUTES PR-head content. Guard test
TestWorkflowDoesNotExecutePRHeadCode in tests/test_openai_review.py
fails CI on any of: pip install, pytest, npm install, cargo run/test,
make, ./configure, maturin develop/build, poetry install/run, pdm,
uv sync/run, tox, setup.py, etc. The maturin entries are load-bearing
for this repo (Rust build per CLAUDE.md is the most likely future
regression vector).
The dismissal API call (gh api PATCH .../code-scanning/alerts/14) will
be run post-merge, separately from this PR.1 parent 7c1e9d0 commit c07ea76
2 files changed
Lines changed: 131 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
58 | 92 | | |
59 | 93 | | |
60 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2665 | 2665 | | |
2666 | 2666 | | |
2667 | 2667 | | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
2668 | 2765 | | |
2669 | 2766 | | |
2670 | 2767 | | |
| |||
0 commit comments