Skip to content

๐Ÿ›ก๏ธ Sentinel: [MEDIUM] Fix Exception handling and empty dir name fallback - #388

Open
seonghobae wants to merge 2 commits into
masterfrom
sentinel/fix-path-matcher-and-empty-dir-15821860853775198300
Open

๐Ÿ›ก๏ธ Sentinel: [MEDIUM] Fix Exception handling and empty dir name fallback#388
seonghobae wants to merge 2 commits into
masterfrom
sentinel/fix-path-matcher-and-empty-dir-15821860853775198300

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

๐Ÿšจ Severity: MEDIUM
๐Ÿ’ก Vulnerability: getPathMatcher can throw IllegalArgumentException causing DoS. Also, processing root directories results in empty titles/h1s which can lead to accessibility issues and potential information disclosure if absolute paths are used as fallbacks.
๐ŸŽฏ Impact: An attacker can cause an application crash (DoS) via malformed glob patterns in .html4ignore. Additionally, poor handling of empty directory names harms accessibility and increases information disclosure risks.
๐Ÿ”ง Fix: Catch Exception broadly when compiling glob patterns, and provide a safe static fallback ("/") for empty directory names.
โœ… Verification: Ensure testProcessDirEmptyNameFallback test passes and manually verify that invalid glob patterns do not crash the program.


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

Summary by CodeRabbit

  • ๋ฒ„๊ทธ ์ˆ˜์ •

    • ์ž˜๋ชป๋œ .html4ignore ํŒจํ„ด์œผ๋กœ ์ธํ•ด ํ”„๋กœ๊ทธ๋žจ์ด ์ค‘๋‹จ๋˜๋Š” ๋ฌธ์ œ๋ฅผ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • ํŒŒ์ผ ์‹œ์Šคํ…œ ๋ฃจํŠธ์—์„œ ๊ฒฝ๋กœ๊ฐ€ ๋น„์ •์ƒ์ ์œผ๋กœ ํ‘œ์‹œ๋˜๊ฑฐ๋‚˜ ์ •๋ณด๊ฐ€ ๋…ธ์ถœ๋  ์ˆ˜ ์žˆ๋Š” ๋ฌธ์ œ๋ฅผ ์™„ํ™”ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • ๋นˆ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋ฆ„์—์„œ๋„ index.html์ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ƒ์„ฑ๋˜๋„๋ก ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ํ…Œ์ŠคํŠธ

    • ์ž˜๋ชป๋œ ํŒจํ„ด๊ณผ ๋นˆ ๊ฒฝ๋กœ ์ฒ˜๋ฆฌ์— ๋Œ€ํ•œ ๊ฒ€์ฆ์„ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

@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.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d12c53f1-bdd9-4629-b95a-f95335b5995a

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 231d391 and e7745f3.

๐Ÿ“’ Files selected for processing (1)
  • src/test/kotlin/html4tree/GlobTest.kt
๐Ÿ“ Walkthrough

Walkthrough

.html4ignore ํŒจํ„ด ํŒŒ์‹ฑ์ด ๋ชจ๋“  ์˜ˆ์™ธ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋„๋ก ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋นˆ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋ฆ„์—๋Š” / fallback์„ ์ ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ด€๋ จ ๋™์ž‘์„ ๊ฒ€์ฆํ•˜๋Š” ํ…Œ์ŠคํŠธ์™€ ๋Œ€์‘ ๋ฌธ์„œ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

Changes

๊ฒฝ๋กœ ์ฒ˜๋ฆฌ ๋ณ€๊ฒฝ

Layer / File(s) Summary
ignore ํŒจํ„ด ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
.jules/sentinel.md, src/main/kotlin/html4tree/main.kt
.html4ignore ํŒจํ„ด ์ƒ์„ฑ์—์„œ ํŠน์ • ์˜ˆ์™ธ๋ฟ ์•„๋‹ˆ๋ผ ๋ชจ๋“  ์˜ˆ์™ธ๋ฅผ ๋ฌด์‹œํ•˜๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ด€๋ จ ๋Œ€์‘ ๋‚ด์šฉ์„ ๋ฌธ์„œ์— ๊ธฐ๋กํ–ˆ์Šต๋‹ˆ๋‹ค.
๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋ฆ„ fallback ๋ฐ ๊ฒ€์ฆ
src/main/kotlin/html4tree/main.kt, src/test/kotlin/html4tree/GlobTest.kt
๋นˆ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋ฆ„์— /๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  HTML <title>๊ณผ <h1>์— ์ ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์ž˜๋ชป๋œ ignore ํŒŒ์ผ๊ณผ ๋นˆ ์ด๋ฆ„ fallback์„ ๊ฒ€์ฆํ•˜๋Š” ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

Estimated code review effort: 2 (Simple) | ~10 minutes

๐Ÿšฅ Pre-merge checks | โœ… 4 | โŒ 1

โŒ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
โœ… Passed checks (4 passed)
Check name Status Explanation
Description Check โœ… Passed Check skipped - CodeRabbitโ€™s high-level summary is enabled.
Title check โœ… Passed ์ œ๋ชฉ์€ ์ž˜๋ชป๋œ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ์™€ ๋นˆ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋ฆ„ fallback์ด๋ผ๋Š” ์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ •ํ™•ํ•˜๊ณ  ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
Linked Issues check โœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check โœ… Passed Check skipped because no linked issues were found for this pull request.
โœจ Finishing Touches ๐Ÿ’ก 1
๐Ÿ“ Generate docstrings ๐Ÿ’ก
  • Create stacked PR
  • Commit on current branch
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel/fix-path-matcher-and-empty-dir-15821860853775198300

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

๐Ÿค– 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.

Inline comments:
In `@src/test/kotlin/html4tree/GlobTest.kt`:
- Around line 27-39: Update testFallbackInlinedEmpty to use a valid temporary
directory and fail on process_dir errors instead of swallowing Exception, then
assert the generated index.html contains the expected empty-name fallback HTML
for โ€œ/โ€. Extend testDirNameFallbackNormal to verify the generated <h1> also
contains the escaped directory name alongside the existing <title> assertion,
using JUnit 4 test behavior.
๐Ÿช„ Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

โ„น๏ธ Review info
โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0eeb53c6-f8d2-41bd-95af-603791f599e1

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between efde64c and 231d391.

๐Ÿ“’ Files selected for processing (3)
  • .jules/sentinel.md
  • src/main/kotlin/html4tree/main.kt
  • src/test/kotlin/html4tree/GlobTest.kt

Comment thread src/test/kotlin/html4tree/GlobTest.kt
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