Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL/HIGH] Fix Unhandled Exception DoS in glob parsing#225

Open
seonghobae wants to merge 1 commit into
masterfrom
sentinel/fix-dos-glob-parsing-15211205123441255329
Open

πŸ›‘οΈ Sentinel: [CRITICAL/HIGH] Fix Unhandled Exception DoS in glob parsing#225
seonghobae wants to merge 1 commit into
masterfrom
sentinel/fix-dos-glob-parsing-15211205123441255329

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

🚨 Severity: CRITICAL/HIGH
πŸ’‘ Vulnerability: html4tree μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ μ„€μ • 파일(.html4ignore)μ—μ„œ μ‚¬μš©μž 제곡 glob νŒ¨ν„΄μ„ νŒŒμ‹±ν•  λ•Œ FileSystems.getDefault().getPathMatcher()λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€. κΈ°μ‘΄ μ½”λ“œλŠ” java.util.regex.PatternSyntaxException만 μ²˜λ¦¬ν•˜μ˜€μœΌλ‚˜, getPathMatcherλŠ” 잘λͺ»λœ 문법에 λŒ€ν•΄ κ·Έ μƒμœ„ 클래슀인 IllegalArgumentException을 λ˜μ§€λŠ” 경우(예: 빈 λ¬Έμžμ—΄, [ λ“± 문법 였λ₯˜)κ°€ μžˆμŠ΅λ‹ˆλ‹€. μ²˜λ¦¬λ˜μ§€ μ•Šμ€ IllegalArgumentException이 λ°œμƒν•˜λ©΄ 전체 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ ν¬λž˜μ‹œ(DoS)둜 μ΄μ–΄μ§‘λ‹ˆλ‹€.
🎯 Impact: κ³΅κ²©μžκ°€ μ•…μ˜μ μœΌλ‘œ μ‘°μž‘λœ .html4ignore 파일(예: [ ν•œ κΈ€μžλ§Œ 포함)을 λŒ€μƒ 디렉토리에 μœ„μΉ˜μ‹œν‚€κ±°λ‚˜ μƒμ„±ν•˜κ²Œ ν•˜λ©΄, ν•΄λ‹Ή 디렉토리λ₯Ό ν¬λ‘€λ§ν•˜λŠ” μˆœκ°„ 크둀러 전체 ν”„λ‘œμ„ΈμŠ€κ°€ μ€‘λ‹¨λ˜λŠ” DoS 곡격이 κ°€λŠ₯ν•©λ‹ˆλ‹€.
πŸ”§ Fix: process_ignore_file λ‚΄λΆ€μ˜ try-catch λΈ”λ‘μ—μ„œ catch λŒ€μƒμ„ java.util.regex.PatternSyntaxExceptionμ—μ„œ μƒμœ„ μ˜ˆμ™ΈμΈ IllegalArgumentException으둜 λ³€κ²½ν•˜μ—¬ λͺ¨λ“  ν˜•μ‹ μ˜ˆμ™Έλ₯Ό ν¬κ΄„ν•˜μ—¬ μ•ˆμ „ν•˜κ²Œ λ¬΄μ‹œ(skip)ν•˜λ„λ‘ μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
βœ… Verification: λ³€κ²½ 사항이 반영된 ν›„ ./gradlew clean test jacocoTestReport jacocoTestCoverageVerification을 μ‹€ν–‰ν•˜μ—¬ μƒˆλ‘­κ²Œ μΆ”κ°€λœ ν…ŒμŠ€νŠΈ μΌ€μ΄μŠ€(SentinelGlobTest)κ°€ ν†΅κ³Όν•˜κ³  ν…ŒμŠ€νŠΈ 컀버리지가 100%둜 μœ μ§€λ˜λŠ” 것을 ν™•μΈν•˜μ˜€μŠ΅λ‹ˆλ‹€.


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

Java의 `FileSystems.getDefault().getPathMatcher("glob:$pattern")`λŠ” ν˜•μ‹μ΄ 잘λͺ»λœ νŒ¨ν„΄(예: `glob:` λ˜λŠ” μ΄μŠ€μΌ€μ΄ν”„ 였λ₯˜ λ“±)이 μž…λ ₯될 경우 `IllegalArgumentException`을 λ°œμƒμ‹œν‚΅λ‹ˆλ‹€.
κΈ°μ‘΄ μ½”λ“œμ—μ„œλŠ” `java.util.regex.PatternSyntaxException`만 catch ν•˜λ„λ‘ μž‘μ„±λ˜μ–΄ μžˆμ—ˆμœΌλ‚˜, μ΄λŠ” `IllegalArgumentException`의 ν•˜μœ„ 클래슀일 λΏμ΄λ―€λ‘œ, λ‹€λ₯Έ ν˜•μ‹ 였λ₯˜λ‘œ μΈν•œ `IllegalArgumentException` λ°œμƒ μ‹œ μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ ν¬λž˜μ‹œ(DoS)κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

이 컀밋은 `IllegalArgumentException` 전체λ₯Ό catch ν•˜λ„λ‘ μˆ˜μ •ν•˜μ—¬ μ²˜λ¦¬λ˜μ§€ μ•Šμ€ μ˜ˆμ™Έλ‘œ μΈν•œ μ„œλΉ„μŠ€ κ±°λΆ€ 취약점을 λ°©μ§€ν•©λ‹ˆλ‹€.
@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.

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