fix(security): sanitize all override diagnostic controls on current main - #414
fix(security): sanitize all override diagnostic controls on current main#414seonghobae wants to merge 4 commits into
Conversation
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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 (2)
📝 WalkthroughWalkthrough
ChangesPolicyOverrideRequest 정규화
Estimated code review effort: 1 (매우 간단) | ~5분 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 |
|
@opencode-agent review Please review the unchanged exact current head |
|
Exact-current-head read-only review request for @opencode-agent review |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
head_sha="293a48ca395d457ae08632b2c94571f9ee958cc2"
base_sha="961f44a19c4ced87f8062b3ab9842a9a08d05235"
repo="ContextualWisdomLab/clearfolio"
pr_number="414"
echo "== Repository checkout =="
git rev-parse HEAD
git status --short
git cat-file -e "${head_sha}^{commit}"
git cat-file -e "${base_sha}^{commit}"
echo
echo "== Exact commit relationship =="
git merge-base --is-ancestor "$base_sha" "$head_sha" && echo "base_is_ancestor=yes" || echo "base_is_ancestor=no"
git diff --name-status "$base_sha" "$head_sha"
echo
echo "== Exact diff =="
git diff --no-ext-diff --unified=80 "$base_sha" "$head_sha" -- \
src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java \
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java
echo
echo "== Production type outline =="
ast-grep outline src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java --items all --view expanded
echo
echo "== Test type outline =="
ast-grep outline src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java --items all --view expanded
echo
echo "== Relevant symbols and diagnostics paths =="
rg -n -C 8 --type java \
'(normalizeHeader|toString\s*\(|getApproval|approvalToken|approver|PolicyOverrideRequest)' \
src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java \
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java
echo
echo "== GitHub PR evidence =="
gh pr view "$pr_number" --repo "$repo" --json number,headRefOid,baseRefOid,isDraft,mergeStateStatus,reviewDecision,statusCheckRollup,reviewThreadsLength of output: 37873 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/clearfolio"
owner="${repo%%/*}"
name="${repo#*/}"
pr_number="414"
echo "== Live main reference and protection =="
gh api "repos/${repo}/git/ref/heads/main" --jq '{ref: .ref, sha: .object.sha}'
gh api "repos/${repo}/branches/main/protection" \
--jq '{required_status_checks, required_pull_request_reviews, enforce_admins, required_linear_history}' \
|| echo "branch_protection_query_unavailable"
echo
echo "== Pull request metadata =="
gh pr view "$pr_number" --repo "$repo" \
--json number,state,isDraft,headRefOid,baseRefOid,mergeable,mergeStateStatus,reviewDecision,latestReviews,url
echo
echo "== Exact-head check runs =="
gh api "repos/${repo}/commits/293a48ca395d457ae08632b2c94571f9ee958cc2/check-runs?per_page=100" \
--jq '[.check_runs[] | {name, status, conclusion, details_url}]'
echo
echo "== Review threads =="
gh api graphql \
-F owner="$owner" \
-F name="$name" \
-F number="$pr_number" \
-f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
headRefOid
baseRefOid
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
path
line
originalLine
comments(first: 20) {
nodes {
author { login }
body
createdAt
}
}
}
}
}
}
}' \
--jq '.data.repository.pullRequest | {
headRefOid,
baseRefOid,
threads: [
.reviewThreads.nodes[] | {
isResolved, isOutdated, path, line, originalLine,
comments: [.comments.nodes[] | {author: .author.login, body, createdAt}]
}
]
}'Length of output: 8840
I found no issues in the requested scope.
The branch-protection configuration could not be read because the GitHub integration received HTTP 403. No branch or PR content was changed.
|
|
@opencode-agent review Review exact head Review read-only; preserve independent reviewer identity. Do not mutate the branch, synthesize author approval, weaken protection, or merge. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/clearfolio"
owner="${repo%%/*}"
name="${repo#*/}"
pr_number="414"
head_sha="293a48ca395d457ae08632b2c94571f9ee958cc2"
echo "== Checked-out commit and requested head =="
git rev-parse HEAD
git status --short
git cat-file -e "${head_sha}^{commit}"
echo "== Live main and ancestry =="
live_main="$(gh api "repos/${repo}/git/ref/heads/main" --jq '.object.sha')"
printf 'live_main=%s\n' "$live_main"
git cat-file -e "${live_main}^{commit}"
git merge-base --is-ancestor "$live_main" "$head_sha" \
&& echo "live_main_is_ancestor=yes" \
|| echo "live_main_is_ancestor=no"
echo "== Exact changed files =="
git diff --name-status "$live_main" "$head_sha"
git diff --no-ext-diff --unified=80 "$live_main" "$head_sha" -- \
src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java \
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java
echo "== Source outlines =="
ast-grep outline src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java --items all --view expanded
ast-grep outline src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java --items all --view expanded
echo "== Relevant source and test contexts =="
rg -n -C 12 --type java \
'(normalizeHeader|toString\s*\(|getApproval|approvalToken|approverId|PolicyOverrideRequest)' \
src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java \
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java
echo "== Exact-head check runs =="
gh api "repos/${repo}/commits/${head_sha}/check-runs?per_page=100" \
--jq '[.check_runs[] | {name, status, conclusion}]'
echo "== PR exact refs and review threads =="
gh api graphql \
-F owner="$owner" -F name="$name" -F number="$pr_number" \
-f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
headRefOid
baseRefOid
mergeable
reviewDecision
reviewThreads(first: 100) {
nodes { isResolved isOutdated path line originalLine }
}
}
}
}' \
--jq '.data.repository.pullRequest'Length of output: 41558
I found no issue in the requested
The requested head is not based on current live I did not modify the branch, approve, weaken protection, or merge. You are interacting with an AI system. |
|
Exact-current-head independent review request for The two-file diagnostic-rendering slice is mergeable; CI, Security Scan, SAST Semgrep, and fuzz are terminal-success; unresolved inline findings are zero. Every ISO control character is replaced in the printable policy-override flag while raw accessors remain unchanged and approval credentials/identity stay redacted. Protected @opencode-agent review Review this exact head read-only. Do not mutate the branch, synthesize author approval, weaken protection, or merge. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/clearfolio"
owner="${repo%%/*}"
name="${repo#*/}"
pr_number="414"
head_sha="293a48ca395d457ae08632b2c94571f9ee958cc2"
echo "== Local requested commit =="
git rev-parse HEAD
git status --short
git cat-file -e "${head_sha}^{commit}"
echo "== Live main and protection =="
live_main="$(gh api "repos/${repo}/git/ref/heads/main" --jq '.object.sha')"
printf 'live_main=%s\n' "$live_main"
gh api "repos/${repo}/branches/main/protection" \
--jq '{required_status_checks,required_pull_request_reviews,enforce_admins,required_linear_history}' \
|| echo "branch_protection_query_unavailable"
echo "== Requested-head relationship to live main =="
git cat-file -e "${live_main}^{commit}"
if git merge-base --is-ancestor "$live_main" "$head_sha"; then
echo "live_main_is_ancestor=yes"
else
echo "live_main_is_ancestor=no"
fi
git merge-base "$live_main" "$head_sha"
git diff --name-status "$live_main" "$head_sha"
echo "== Requested-head changes relative to its first parent =="
git diff --name-status "${head_sha}^" "$head_sha"
git diff --no-ext-diff --unified=100 "${head_sha}^" "$head_sha" -- \
src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java \
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java
echo "== Relevant source outlines =="
ast-grep outline src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java --items all --view expanded
ast-grep outline src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java --items all --view expanded
echo "== Relevant source and test context =="
rg -n -C 15 --type java \
'(normalizeHeader|toString\s*\(|policyOverride\s*\(|approvalToken\s*\(|approverId\s*\(|PolicyOverrideRequest)' \
src/main/java/com/clearfolio/viewer/service/PolicyOverrideRequest.java \
src/test/java/com/clearfolio/viewer/service/PolicyOverrideRequestTest.java
echo "== Exact-head checks =="
gh api "repos/${repo}/commits/${head_sha}/check-runs?per_page=100" \
--jq '[.check_runs[] | {name,status,conclusion,details_url}]'
echo "== PR references and review threads =="
gh api graphql \
-F owner="$owner" -F name="$name" -F number="$pr_number" \
-f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
headRefOid
baseRefOid
mergeable
mergeStateStatus
reviewDecision
reviewThreads(first: 100) {
nodes {
isResolved
isOutdated
path
line
originalLine
}
}
}
}
}' \
--jq '.data.repository.pullRequest'Length of output: 37352
I found no issue in the requested
I cannot confirm this as a two-file-only review against current protected
Update the branch onto current
|
Objective
Prevent log and terminal control injection through client-provided policy-override diagnostics while retaining redaction of approval secrets and identities.
Exact current-head evidence
961f44a19c4ced87f8062b3ab9842a9a08d05235;dcc36bacc974cde95eefa4d45ee70f3951b7c11c;293a48ca395d457ae08632b2c94571f9ee958cc2;Contract
Every ISO control character, including ESC, NUL, newline, and tab, is replaced with
_in the printable override flag. Raw accessor behavior is unchanged, while approval-token and approver identity remain redacted from diagnostic output.Scope boundary
Diagnostic rendering only. Authorization, token verification, audit pseudonymization, tenant identity, and unrelated logging remain unchanged.
Merge gate
Keep this exact head unchanged. Auto-merge may act only after live checks remain successful, zero valid unresolved findings remain, and a qualifying independent non-author approval is attached to this exact head. Automated evidence and predecessor reviews do not transfer.