Skip to content

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ์šฐํšŒ(Path Traversal) ์ทจ์•ฝ์  ์ˆ˜์ •#76

Open
seonghobae wants to merge 1 commit into
masterfrom
sentinel/fix-symlink-traversal-5712274623037379069
Open

๐Ÿ›ก๏ธ Sentinel: [CRITICAL] ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ์šฐํšŒ(Path Traversal) ์ทจ์•ฝ์  ์ˆ˜์ •#76
seonghobae wants to merge 1 commit into
masterfrom
sentinel/fix-symlink-traversal-5712274623037379069

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

๐Ÿšจ Severity: CRITICAL
๐Ÿ’ก Vulnerability: go ํ•จ์ˆ˜์—์„œ File(topDir).canonicalFile์„ ํ˜ธ์ถœํ•˜์—ฌ ๋จผ์ € ์‹ค์ œ ๋Œ€์ƒ ๊ฒฝ๋กœ๋กœ ๋ณ€ํ™˜ํ•œ ํ›„, LinkOption.NOFOLLOW_LINKS ์˜ต์…˜์œผ๋กœ ๋””๋ ‰ํ† ๋ฆฌ ์—ฌ๋ถ€๋ฅผ ๊ฒ€์ฆํ•˜๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ์‹ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ์ž…๋ ฅํ•ด๋„ ํ•ญ์ƒ ์‹ค์ œ ๋Œ€์ƒ ๊ฒฝ๋กœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ฒ€์‚ฌํ•˜๊ฒŒ ๋˜์–ด ์ œํ•œ์ด ์šฐํšŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
๐ŸŽฏ Impact: ์‚ฌ์šฉ์ž๊ฐ€ ์˜๋„์น˜ ์•Š๊ฒŒ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ œํ•œ๋œ ์ƒ์œ„ ๊ฒฝ๋กœ๋‚˜ ์‹œ์Šคํ…œ์˜ ๋‹ค๋ฅธ ํŒŒ์ผ/๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ(Path Traversal)์— ์ ‘๊ทผํ•  ์œ„ํ—˜์ด ์žˆ์Šต๋‹ˆ๋‹ค.
๐Ÿ”ง Fix: canonicalFile๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ ์ „ ์›๋ณธ File ๊ฐ์ฒด๋ฅผ ๋จผ์ € ๊ฒ€์‚ฌํ•˜์—ฌ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
โœ… Verification: ./gradlew test jacocoTestReport๋ฅผ ์‹คํ–‰ํ•˜์—ฌ 100% ์ฝ”๋“œ ์ปค๋ฒ„๋ฆฌ์ง€๋ฅผ ๋งŒ์กฑํ•˜๋Š”์ง€ ๋ฐ testGoRejectsSymlinkTopDir ํ…Œ์ŠคํŠธ๊ฐ€ ์„ฑ๊ณตํ•˜๋Š”์ง€ ํ™•์ธ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค.


PR created automatically by Jules for task 5712274623037379069 started by @seonghobae

๐Ÿšจ Severity: CRITICAL
๐Ÿ’ก Vulnerability: `go` ํ•จ์ˆ˜์—์„œ `File(topDir).canonicalFile`์„ ํ˜ธ์ถœํ•˜์—ฌ ๋จผ์ € ์‹ค์ œ ๋Œ€์ƒ ๊ฒฝ๋กœ๋กœ ๋ณ€ํ™˜ํ•œ ํ›„, `LinkOption.NOFOLLOW_LINKS` ์˜ต์…˜์œผ๋กœ ๋””๋ ‰ํ† ๋ฆฌ ์—ฌ๋ถ€๋ฅผ ๊ฒ€์ฆํ•˜๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋กœ ์ธํ•ด ์‹ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ์ž…๋ ฅํ•ด๋„ ํ•ญ์ƒ ์‹ค์ œ ๋Œ€์ƒ ๊ฒฝ๋กœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ฒ€์‚ฌํ•˜๊ฒŒ ๋˜์–ด ์ œํ•œ์ด ์šฐํšŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
๐ŸŽฏ Impact: ์‚ฌ์šฉ์ž๊ฐ€ ์˜๋„์น˜ ์•Š๊ฒŒ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ œํ•œ๋œ ์ƒ์œ„ ๊ฒฝ๋กœ๋‚˜ ์‹œ์Šคํ…œ์˜ ๋‹ค๋ฅธ ํŒŒ์ผ/๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ(Path Traversal)์— ์ ‘๊ทผํ•  ์œ„ํ—˜์ด ์žˆ์Šต๋‹ˆ๋‹ค.
๐Ÿ”ง Fix: `canonicalFile`๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ ์ „ ์›๋ณธ `File` ๊ฐ์ฒด๋ฅผ ๋จผ์ € ๊ฒ€์‚ฌํ•˜์—ฌ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
โœ… Verification: `./gradlew test jacocoTestReport`๋ฅผ ์‹คํ–‰ํ•˜์—ฌ 100% ์ฝ”๋“œ ์ปค๋ฒ„๋ฆฌ์ง€๋ฅผ ๋งŒ์กฑํ•˜๋Š”์ง€ ๋ฐ `testGoRejectsSymlinkTopDir` ํ…Œ์ŠคํŠธ๊ฐ€ ์„ฑ๊ณตํ•˜๋Š”์ง€ ํ™•์ธ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค.
Copilot AI review requested due to automatic review settings July 1, 2026 20:53
@google-labs-jules

Copy link
Copy Markdown

๐Ÿ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a ๐Ÿ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a critical symlink-based path traversal bypass in go() by ensuring the โ€œtop directory must be a real directoryโ€ validation is performed on the original user-supplied path before any canonicalization resolves symlinks.

Changes:

  • Validate topDir with Files.isDirectory(..., LinkOption.NOFOLLOW_LINKS) before calling canonicalFile to prevent symlink-root bypass.
  • Update .jules/sentinel.md with a new entry describing the symlink-check bypass learning.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/main/kotlin/html4tree/main.kt Reorders top directory validation to occur before canonicalization, preventing symlink-root traversal bypass.
.jules/sentinel.md Adds a new sentinel entry about the vulnerability (but currently overwrites prior history).

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .jules/sentinel.md
Comment on lines +1 to +4
## 2024-07-01 - ์‹ฌ๋ณผ๋ฆญ ๋งํฌ(Symlink) ๊ฒ€์‚ฌ ์šฐํšŒ ์ทจ์•ฝ์ 
**Vulnerability:** `canonicalFile`์„ ํ˜ธ์ถœํ•œ ํ›„ `LinkOption.NOFOLLOW_LINKS` ์˜ต์…˜์„ ์‚ฌ์šฉํ•ด ๋””๋ ‰ํ† ๋ฆฌ ๊ฒ€์ฆ์„ ์‹œ๋„ํ•˜์—ฌ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ๊ฒ€์‚ฌ๊ฐ€ ๋ฌด๋ ฅํ™”๋จ. (Path Traversal ์šฐ๋ ค)
**Learning:** File ๊ฐ์ฒด์˜ `canonicalFile`์„ ํ˜ธ์ถœํ•˜๋ฉด ๋‚ด๋ถ€์ ์œผ๋กœ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ๊ฐ€ ํ‰๊ฐ€๋˜์–ด ์‹ค์ œ ๋Œ€์ƒ ๊ฒฝ๋กœ๋กœ ๋ณ€ํ™˜๋จ. ๋ณ€ํ™˜๋œ ๊ฒฝ๋กœ์— ๋Œ€ํ•ด ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ์—ฌ๋ถ€๋ฅผ ๊ฒ€์‚ฌํ•˜๋ฉด ํ•ญ์ƒ "์‹ฌ๋ณผ๋ฆญ ๋งํฌ๊ฐ€ ์•„๋‹˜"์œผ๋กœ ํ‰๊ฐ€๋จ.
**Prevention:** ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ์—ฌ๋ถ€๋‚˜ ๊ฒ€์‚ฌ๋ฅผ ์ˆ˜ํ–‰ํ•  ๋•Œ๋Š” ๋Œ€์ƒ ๊ฒฝ๋กœ๋กœ ๋ณ€ํ™˜(`canonicalFile`)ํ•˜๊ธฐ ์ „์— ์›๋ณธ ํŒŒ์ผ ๊ฒฝ๋กœ ๊ฐ์ฒด ์ž์ฒด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ฒ€์‚ฌํ•ด์•ผ ํ•จ.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head evidence but found unresolved reviewer or review-agent threads before approval.

Findings

1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved reviewer thread blocks automated approval

  • Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human or review-agent thread evidence on the current pull request.
  • Root cause: Reviewer and review-agent feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
  • Fix: Address or resolve the listed reviewer thread(s), then re-run OpenCode on the current head.
  • Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE, including bot review agents other than OpenCode itself.

Review thread evidence

Latest unresolved reviewer thread evidence

.jules/sentinel.md line 4

  • Latest reviewer comment: @copilot-pull-request-reviewer at 2026-07-01T20:55:34Z

  • Comment URL: #76 (comment)

  • Comment excerpt: This edit replaces the entire '.jules/sentinel.md' history with a single entry, which discards previously recorded security learnings. The other '.jules/*.md' files (e.g., '.jules/palette.md') retain prior entries and append new ones, so this looks like accidental data loss rather than an intentional update. / Consider restoring the existing entries and adding this new 2024-07-01 entry in addition (append or prepend), so the sentinel log remains cumulative.

  • Result: REQUEST_CHANGES

  • Reason: unresolved reviewer or review-agent thread(s) were present before approval.

  • Head SHA: 8afed0b1872e23f2806dd5d60619eda2a41daa69

  • Workflow run: 28547068065

  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (2 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (2 files)"]
  R1 --> V1["required checks"]
Loading

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 8afed0b1872e23f2806dd5d60619eda2a41daa69
  • Workflow run: 28547068065
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode reviewed the current-head evidence but found unresolved reviewer or review-agent threads before approval.

Findings

1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved reviewer thread blocks automated approval

  • Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human or review-agent thread evidence on the current pull request.
  • Root cause: Reviewer and review-agent feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
  • Fix: Address or resolve the listed reviewer thread(s), then re-run OpenCode on the current head.
  • Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE, including bot review agents other than OpenCode itself.

Review thread evidence

Latest unresolved reviewer thread evidence

.jules/sentinel.md line 4

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (2 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (2 files)"]
  R1 --> V1["required checks"]
Loading

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.

2 participants