Repository navigation
fix(#7058): canonicalize symlinks in harness base-path containment check - #7061
Conversation
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all |
PR Summary by QodoCover harness dispatch tests on macOS
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 8:37 PM UTC · Completed 8:56 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.66 |
|
Risk Assessment: moderate (2/5) DetailsComposite holds at 2 (moderate): Tier1 metadata is unchanged from the prior review (4 files, 1 protected CI-workflow path, no dependency changes, non-first-time author), and although this increment is larger than the prior one (+41/-7 vs +5/-3, plus 173 new test lines), it remains an in-place tightening of the same containment/symlink-canonicalization logic already reviewed rather than a new risk surface. High historical fix/revert churn and multi-author contention on compose.go keep Tier2 near its prior level, and Tier3 stays low given tight issue-scope alignment and no new risk labels, offset only by the lack of a feature flag for this production security-adjacent check; weighted composite rounds to the same score of 2. Previous runRisk Assessment: moderate (2/5) DetailsRe-review anchoring holds at 2: Tier 1 signals (file count 4, protected-path count 1, no dependency changes, non-first-time author) are unchanged from the prior assessment, and the incremental compose.go/compose_test.go hardening (+5/-3, +15/-0) is a further tightening of the same containment logic rather than a scope expansion; weighted composite (Tier1 2.0x0.5 + Tier2 3.0x0.3 + Tier3 2x0.2 = 2.3) rounds to the same score of 2 (moderate), driven by the CI workflow touch and high historical churn/coupling on the harness compose files, offset by strong issue-scope alignment and no feature-flag/rollback path for the production check change. Previous run (2)Risk Assessment: moderate (2/5) DetailsScore holds at 2 (moderate) on re-review: Tier 1 rises modestly versus the prior test-only characterization because compose.go now carries a non-trivial (+34/-5) rewrite of security-relevant containment logic alongside the CI workflow tweak, offset by small blast radius, a 0.50 test ratio, and no dependency changes; Tier 2 shows high historical churn typical of this hot file; Tier 3 shows strong issue-to-PR alignment despite lacking a rollback flag, so the weighted composite still rounds to moderate. Previous run (3)Risk Assessment: moderate (2/5) DetailsSmall, test-focused fix with a minor CI workflow tweak in a heavily active codebase area; moderate score reflects the CI file touch and high historical churn on these files, offset by minimal blast radius and clear issue alignment. |
ReviewFindingsMedium
Low
Correctness / Security noteBoth the correctness and security sub-agents independently confirmed that the prior medium-severity Previous runReviewFindingsMedium
Low
Correctness noteThe correctness sub-agent confirmed the prior low-severity finding (mixed-alias Next steps:
Previous run (2)ReviewFindingsMedium
Low
Next steps:
Previous run (3)ReviewFindingsMedium
Low
Next steps:
Previous run (4)ReviewFindingsHigh
Medium
Low
Next steps:
|
|
Implemented and pushed in aece2be.
|
waynesun09
left a comment
There was a problem hiding this comment.
Review-only pass on the updated head (7843c49c8) — three findings, all verified by running fixtures against this head and against the pre-fix parent. No approval or change request implied.
Canonicalize the temporary workspace used by the composition test. This prevents macOS /var aliases from tripping containment checks. Run harnessdispatch tests in the existing Darwin CI job. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
Canonicalize workspace and base paths before containment checks. Signed-off-by: Shai Revivo <srevivo@redhat.com> Co-authored-by: Codex <noreply@openai.com>
Canonicalize the existing parent directory when a local base file does not yet exist. This keeps workspace aliases consistent before reporting the underlying load error. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
Keep lexical base paths for loading and ancestor resolution while using canonical paths for containment and cycle detection. Distinguish traversal from symlink escapes and run containment tests on Darwin. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
511f50d to
56a8a8d
Compare
|
🤖 Finished Review · ✅ Success · Started 3:24 AM UTC · Completed 3:44 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $4.05 |
Check unresolved and canonical workspace paths when base resolution fails. This keeps mixed aliases from misclassifying missing paths as escapes. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
|
Fixed the remaining low The missing-parent fallback now reports a workspace escape only when both the unresolved and canonical workspace forms reject the base path. Added Verification:
The separate protected-path finding still requires human approval for |
|
🤖 Finished Review · ✅ Success · Started 8:15 AM UTC · Completed 8:33 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $4.70 |
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
|
🤖 Review · Commit: |
|
🤖 Finished Review · ✅ Success · Started 9:24 PM UTC · Completed 9:41 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $3.71 |
Superseded by updated review
Summary
Canonicalize local harness base paths and the workspace containment root before
comparing them, so macOS
/varto/private/varaliases do not falsely rejectvalid composition and symlink escapes remain blocked. Load the same resolved
path that passed containment validation, closing an absolute-path
symlink-plus-
..check/open divergence.Extend the existing Darwin job to exercise the harness and harness-dispatch
packages that cover this behavior.
Related Issue
Fixes #7058
Changes
symlink-plus-
..traversal with regression testsinternal/harnessandinternal/harnessdispatchtests in the existingDarwin CI job
Testing
make lintmake go-testmake go-vetloadBaseChainfunction coverage: 94.9%Checklist
Approval required
.github/workflows/lint.ymlchange