Skip to content

Auto-finish: agent/codex/skip-unstarted-github-billing-checks-saf-2026-08-31-10-06 - #743

Merged
NagyVikt merged 19 commits into
mainfrom
agent/codex/skip-unstarted-github-billing-checks-saf-2026-08-31-10-06
Aug 31, 2026
Merged

Auto-finish: agent/codex/skip-unstarted-github-billing-checks-saf-2026-08-31-10-06#743
NagyVikt merged 19 commits into
mainfrom
agent/codex/skip-unstarted-github-billing-checks-saf-2026-08-31-10-06

Conversation

@NagyVikt

Copy link
Copy Markdown
Collaborator

Summary

  • Auto-finish: agent/codex/skip-unstarted-github-billing-checks-saf-2026-08-31-10-06

Test plan

  • verified locally

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

2 finding(s) — 🟠 2 high

Merge gate: blocked — 2 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/pr.js:98 The billing-waiver detector trusts an annotation shape that pull-request-controlled workflow code can reproduce exactly.
🟠 high src/finish/review-gate.js:207-212 The UNSTABLE bypass accepts every skipped check merely because at least one unrelated check has a billing waiver.

Provider codex · commit 3747838

Comment thread src/pr.js
Comment thread src/finish/review-gate.js Outdated
- HIGH src/pr.js:98 The billing-waiver detector trusts an annotation shape that pull-request-controlled workflow code can reproduce exactly. A workflow can emit the same path, line, level, blank fields, and message, causing a genuine failed check to be waived and leaving security dependent on a preflight script that the same PR may modify; the waiver must rely on trusted GitHub job metadata that workflow output cannot forge.
- HIGH src/finish/review-gate.js:212 The UNSTABLE bypass accepts every skipped check merely because at least one unrelated check has a billing waiver. Consequently, a skipped required security, deployment, or test check can be silently treated as a billing companion and the PR can pass the merge gate without that check being audited.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/finish/review-gate.js:236 The no-verdict fallback treats every skipped check as a billing companion whenever any billing waiver exists.

Provider codex · commit 2d75b5a

Comment thread src/finish/review-gate.js Outdated

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/finish/review-gate.js:236-240 Waived checks can pass without corresponding audited waiver names when GitHub supplies no merge-state verdict.

Provider codex · commit 22e836b

Comment thread src/finish/review-gate.js Outdated
- HIGH src/finish/review-gate.js:240 Waived checks can pass without corresponding audited waiver names when GitHub supplies no merge-state verdict. In that path `allAccountedFor` trusts the numeric waived count alone, so a malformed or incomplete snapshot can return green without propagating `billingWaivedNames`, bypassing both CI and the mandatory local preflight.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟡 1 medium

Merge gate: pass — no blocking findings (blocks on high/critical).

Severity Location Finding
🟡 medium src/pr.js:313-315 Billing classification repeats two synchronous GitHub API requests for every failed check on every CI poll.

Provider codex · commit c931b00

Comment thread src/pr.js
@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 08:45
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 09:03

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:181-183 The mandatory fallback executes a preflight script from the untrusted PR worktree.

Provider codex · commit c931b00

Comment thread templates/scripts/agent-branch-finish.sh

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/pr.js:102 The annotations request incorrectly uses an Actions job ID as a check-run ID.

Provider codex · commit d7003bb

Comment thread src/pr.js
- HIGH src/pr.js:102 The annotations request incorrectly uses an Actions job ID as a check-run ID. The `/actions/jobs/{job_id}` and `/check-runs/{check_run_id}/annotations` endpoints use different identifiers, so real GitHub requests will normally fail and billing-blocked checks will never be waived; the test masks this by assigning both fake endpoints the same ID.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

2 finding(s) — 🟡 2 medium

Merge gate: pass — no blocking findings (blocks on high/critical).

Severity Location Finding
🟡 medium src/pr.js:98 The billing-waiver check treats a missing or null runner_id as zero.
🟡 medium src/pr.js:318 Billing detection performs two synchronous GitHub API requests for every failed check on every polling snapshot.

Provider codex · commit 394bcda

Comment thread src/pr.js
Comment thread src/pr.js
@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 09:24
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 09:27

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟡 1 medium

Merge gate: pass — no blocking findings (blocks on high/critical).

Severity Location Finding
🟡 medium src/pr.js:100 A malformed or missing check_run_url throws instead of failing closed as a non-waivable check.

Provider codex · commit 394bcda

Comment thread src/pr.js
@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 09:28

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

2 finding(s) — 🟠 1 high · 🟡 1 medium

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/pr.js:72 The billing waiver is not bound to the CheckRun being classified.
🟡 medium templates/scripts/agent-branch-finish.sh:160 Materializing the trusted preflight with git show breaks valid preflight paths stored as symbolic links.

Provider codex · commit fa5db7b

Comment thread src/pr.js
Comment thread templates/scripts/agent-branch-finish.sh

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/pr.js:120 GitHub Actions job IDs are incorrectly required to equal check-run IDs.

Provider codex · commit 830ab5c

Comment thread src/pr.js
NagyVikt added 2 commits August 31, 2026 11:46
- HIGH src/pr.js:120 GitHub Actions job IDs are incorrectly required to equal check-run IDs. These are distinct GitHub entities and generally have different IDs, so legitimate billing-blocked jobs will never be waived; the later check_run_url validation already safely associates the job with the expected check run.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:160-164 The mandatory preflight is copied to an unrelated temporary path before execution.

Provider codex · commit 6ac5af3

Comment thread templates/scripts/agent-branch-finish.sh Outdated

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:215 The mandatory “trusted” preflight still executes with the untrusted PR worktree as its current directory.

Provider codex · commit 687003e

Comment thread templates/scripts/agent-branch-finish.sh Outdated

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:229 The mandatory preflight runs with the trusted base archive as its working directory, so existing preflight scripts that test . will

Provider codex · commit b0f6e59

Comment thread templates/scripts/agent-branch-finish.sh Outdated

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high src/finish/review-gate.js:242-244 The trusted merge-state branches bypass waiver-accounting validation.

Provider codex · commit d3705eb

Comment thread src/finish/review-gate.js Outdated

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:170-172 The trusted preflight path can escape the extracted base archive through a symlink.

Provider codex · commit df76842

Comment thread templates/scripts/agent-branch-finish.sh Outdated

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

2 finding(s) — 🟠 1 high · 🟡 1 medium

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:170-171 The mandatory-preflight target-awareness check can be satisfied by a comment or unused string.
🟡 medium src/pr.js:370 Billing-waiver detection performs synchronous GitHub API requests once per failing check during every status poll.

Provider codex · commit cc3d47c

Comment thread templates/scripts/agent-branch-finish.sh
Comment thread src/pr.js
- HIGH templates/scripts/agent-branch-finish.sh:171 The mandatory-preflight target-awareness check can be satisfied by a comment or unused string. `grep` proves only that the variable name occurs somewhere, so a script that still tests the archived base tree can pass while the billing-waived PR worktree remains untested, defeating the fail-closed guarantee.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:176-177 The mandatory-preflight target-awareness check is bypassable because it only searches for the environment variable's name.

Provider codex · commit 5ff49f0

Comment thread templates/scripts/agent-branch-finish.sh

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

No findings. Nothing worth an inline comment in this diff.


Provider codex · commit b2072c7

@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 13:50
@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 13:51

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:161 Mandatory preflight trust is bypassed for absolute script paths.

Provider codex · commit b2072c7

Comment thread templates/scripts/agent-branch-finish.sh
Constraint: Preserve optional absolute preflight support while forcing billing-waived runs through the trusted base archive.\nTested: bash -n templates/scripts/agent-branch-finish.sh; node --test test/finish-preflight-flag.test.js
@NagyVikt
NagyVikt marked this pull request as draft August 31, 2026 13:59

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟠 1 high

Merge gate: blocked — 1 blocking finding(s) (blocks on high/critical).

Severity Location Finding
🟠 high templates/scripts/agent-branch-finish.sh:157-158 Mandatory preflight resolution accidentally accepts absolute configured paths.

Provider codex · commit 3c114fa

Comment thread templates/scripts/agent-branch-finish.sh Outdated
- HIGH templates/scripts/agent-branch-finish.sh:158 Mandatory preflight resolution accidentally accepts absolute configured paths. Concatenating an absolute value such as `/scripts/agent-preflight.sh` with `$trusted_tree/` can resolve to the archived script, but `run_preflight` later classifies it as absolute and skips the capability check, trusted working directory, and target-worktree argument protocol.

@NagyVikt NagyVikt left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ GitGuardex code-assist

1 finding(s) — 🟡 1 medium

Merge gate: pass — no blocking findings (blocks on high/critical).

Severity Location Finding
🟡 medium templates/scripts/agent-branch-finish.sh:222 The trusted-tree check rejects valid preflight paths after realpath canonicalizes them.

Provider codex · commit e545f5f

Comment thread templates/scripts/agent-branch-finish.sh
@NagyVikt
NagyVikt marked this pull request as ready for review August 31, 2026 14:04
@NagyVikt
NagyVikt merged commit 1562348 into main Aug 31, 2026
5 checks passed
@NagyVikt
NagyVikt deleted the agent/codex/skip-unstarted-github-billing-checks-saf-2026-08-31-10-06 branch August 31, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant