fix(security): isolate reviewer GitHub CLI subprocess environment - #180
fix(security): isolate reviewer GitHub CLI subprocess environment#180seonghobae wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughGitHub CLI 자식 프로세스의 환경을 허용 목록으로 제한했습니다. 선택적 ChangesGitHub CLI 환경 경계
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
reviewer/tests/test_github_io_environment_boundary.py (1)
83-85: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
[REDACTED]대체 결과를 검증하십시오.현재 검증은 원본 토큰이 없다는 사실만 확인합니다. 토큰을 빈 문자열로 제거하는 회귀도 통과할 수 있습니다. PR 계약을 고정하려면
[REDACTED]가 오류 상세에 포함되는지 검증하십시오.수정 예시
detail = str(raised.value) assert token not in detail assert "authentication failed" in detail + assert "retry token=[REDACTED]" in detail🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@reviewer/tests/test_github_io_environment_boundary.py` around lines 83 - 85, Update the assertion for detail derived from raised.value to verify that the literal "[REDACTED]" appears in the error details, while retaining the existing checks that the original token is absent and the authentication failure message is present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@reviewer/tests/test_github_io_environment_boundary.py`:
- Around line 83-85: Update the assertion for detail derived from raised.value
to verify that the literal "[REDACTED]" appears in the error details, while
retaining the existing checks that the original token is absent and the
authentication failure message is present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 928832e6-ace5-47da-afbb-4ae59cf3fe0a
📒 Files selected for processing (2)
reviewer/noema_reviewer/github_io.pyreviewer/tests/test_github_io_environment_boundary.py
|
Superseded by protected successor #193. Fresh proof immediately before closure: protected |
Closes #175.
RCA
Protected
mainreviewer GitHub I/O usedsubprocess.run(..., shell=False)without an explicit child environment and retained raw non-zero child stderr. Theghsubprocess could therefore inherit unrelated model/provider/App/cloud credentials, proxy/HOME/launcher configuration, or other future parent authority, and a failing child could echo the explicitly delegatedGH_TOKENinto retained diagnostics.The selected narrow remedy makes the child environment explicit and fail-closed: pinned
GH_HOST=github.com, deterministicNO_COLOR=1, optional non-emptyPATH, optional explicitGH_TOKEN, and nothing else. Non-zero diagnostics redact the exact delegated token before they can become retained RuntimeError text. Shell-free execution and the existing injectable runner interface remain unchanged.Test-first lineage
Protected/live base throughout this line:
fa62a30f08122778d2db4a27fbb9b99a82dbac9a.1202b9b364791e9829145198e6ec63fd7c00f3a8— test-only hostile-parent and delegated-token diagnostic contract, committed before production implementation. Its application/reviewer/Security Scan runs were cancelled by branch concurrency and are not promoted to terminal RED evidence.0070ccf6ab06c24569e893195afa420bd496f029— production least-authority child environment and exact delegated-token redaction.67c3e0fb3d1a19416712cb64d38e40efdac8afe5— unchanged exact GREEN head, adding the branch contract that absent optionalPATH/GH_TOKENcannot widen the child environment.Exact current-head proof
For unchanged head
67c3e0fb3d1a19416712cb64d38e40efdac8afe5on live protected basefa62a30f08122778d2db4a27fbb9b99a82dbac9a:cirun31521620956, verify job93879769402: terminal success; the job reports exact head67c3e0fb3d1a19416712cb64d38e40efdac8afe5and its exact-checkout, package-manager, install andrelease verifysteps all succeeded;reviewer-cirun31521621119, reviewer job93879770053: terminal success on the same exact head; reviewer 100% line+branch coverage, 100% docstring gate, authenticated/scanned sandbox image and real no-network CodeGraph sandbox smoke all succeeded;Security Scanrun31521620960: terminal success. OSV, supported dependency-review, Trivy filesystem and Scorecard jobs completed successfully under central.githubrevision6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba; OSV/dependency-review/Trivy remain the applicable hard security evidence while Scorecard is posture evidence;Skipped conditional fallback/reporting steps inside otherwise successful jobs are not promoted to passing evidence; the applicable hard jobs above independently completed successfully. No cancelled predecessor evidence transfers.
Authority boundary
This repair narrows only reviewer
ghchild-process authority and retained failure diagnostics. Technical GREEN is not independent approval or live-ruleset proof. No merge is authorized until the unchanged exact head independently satisfies actual Noema/CWL governance and any qualifying non-author formal approval requirement. This PR does not provision reviewer authority, publish a release, deploy production, establish KPI/revenue/legal/IP-transfer evidence, choose an outbound license, or make an acquisition-readiness claim.Summary by CodeRabbit
보안 개선
버그 수정
테스트