Skip to content

🛡️ Sentinel: [MEDIUM] Fix Exception handling and empty dir name fallback - #388

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

🛡️ 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

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by the two focused branches #378 and #395. Fresh diff comparison shows #378 carries the same getPathMatcher fail-safe production change with the stronger exact NUL/IllegalArgumentException regression, while #395 carries the same / empty-directory fallback with direct generated <title> and <h1> assertions. Keeping this combined branch open duplicates both source regions and increases conflict/merge risk without a unique product contract.

@seonghobae seonghobae closed this Aug 9, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by the two focused branches #378 and #395. Fresh diff comparison shows #378 carries the same getPathMatcher fail-safe production change with the stronger exact NUL/IllegalArgumentException regression, while #395 carries the same / empty-directory fallback with direct generated <title> and <h1> assertions. Keeping this combined branch open duplicates both source regions and increases conflict/merge risk without a unique product contract.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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