Skip to content

๐Ÿ›ก๏ธ Sentinel: [๋ณด์•ˆ ๊ฐœ์„ ] ์ž…๋ ฅ ๊ฒฝ๋กœ ๊ธธ์ด๋ฅผ ์ œํ•œํ•˜์—ฌ DoS ๋ฐ OOM ๋ฐฉ์ง€ - #608

Closed
seonghobae wants to merge 1 commit into
masterfrom
sentinel/fix-dos-oom-path-length-5718763406024739672
Closed

๐Ÿ›ก๏ธ Sentinel: [๋ณด์•ˆ ๊ฐœ์„ ] ์ž…๋ ฅ ๊ฒฝ๋กœ ๊ธธ์ด๋ฅผ ์ œํ•œํ•˜์—ฌ DoS ๋ฐ OOM ๋ฐฉ์ง€#608
seonghobae wants to merge 1 commit into
masterfrom
sentinel/fix-dos-oom-path-length-5718763406024739672

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

์ด PR์€ ์œ ํšจ ๋ณด์•ˆ delta๊ฐ€ ์—†์–ด ๋ณ‘ํ•ฉํ•˜์ง€ ์•Š๊ณ  ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค. ๋™์ผํ•œ 4,096-character cap ๊ฐ€์„ค์€ canonical repair lane #598์—์„œ realistic RED๋กœ ๋ฐ˜์ฆํ–ˆ๊ณ , portable filesystem contract๋กœ ๊ต์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด branch์˜ ์ „์ฒด semantic delta๋Š” ์„ธ ๊ฐ€์ง€๋ฟ์ž…๋‹ˆ๋‹ค: go()์— require(topDir.length <= 4096) ์ถ”๊ฐ€, 4,097์ž ๋ฌธ์ž์—ด์ด IllegalArgumentException์„ ๋‚ด์•ผ ํ•œ๋‹ค๋Š” ํ…Œ์ŠคํŠธ, ๊ทธ๋ฆฌ๊ณ  ์ด๋ฅผ MEDIUM DoS/OOM ๋ฐฉ์–ด๋ผ๊ณ  ์ผ๋ฐ˜ํ™”ํ•œ Sentinel journal์ž…๋‹ˆ๋‹ค. ์ด ์…‹์€ ๊ฐ™์€ ๊ฒ€์ฆ๋˜์ง€ ์•Š์€ ์ „์ œ๋ฅผ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค.

๋ฌธ์ œ๋Š” Kotlin String.length == 4097 ์ž์ฒด๊ฐ€ OOM/DoS ๊ฒฝ๊ณ„๋ผ๋Š” ๊ทผ๊ฑฐ๊ฐ€ ์—†๊ณ , pathname ์ œ์•ฝ์€ OS/filesystem๋ณ„๋กœ ๋‹ค๋ฅด๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค. Java File์˜ pathname ๋ณ€ํ™˜์€ system-dependent์ด๋ฉฐ POSIX/Windows pathname semantics๋„ ๋™์ผํ•œ ๊ณ ์ • 4,096-character ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ invariant๋ฅผ ์ œ๊ณตํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ด ๋ณ€๊ฒฝ์€ ์ •์ƒ ์ž…๋ ฅ์„ ์ž„์˜๋กœ ๊ฑฐ๋ถ€ํ•  ์ˆ˜ ์žˆ๊ณ  ์‹ค์ œ resource-exhaustion ์›์ธ(directory count/fan-out/generated bytes/filesystem calls/elapsed time/peak RSS)์„ ๋‹ค๋ฃจ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Canonical repair #598์˜ current lineage๋Š” ๋ฐ˜๋Œ€ ๊ณ„์•ฝ์„ ๋ช…์‹œ์ ์œผ๋กœ ๊ณ ์ •ํ•ฉ๋‹ˆ๋‹ค: 4,097์ž๋ผ๋Š” ์ด์œ ๋งŒ์œผ๋กœ ๋ณ„๋„ path-length ์˜ค๋ฅ˜๋ฅผ ๋‚ด์ง€ ์•Š์œผ๋ฉฐ, arbitrary 4,096 gate๋ฅผ ์ œ๊ฑฐํ•˜๊ณ , ์‹ค์ œ large-tree resource behavior๋ฅผ ๋ณ„๋„ product/technical Gap์œผ๋กœ ์ถ”์ ํ•ฉ๋‹ˆ๋‹ค. #598 exact head b18b1de3bf881ef51c863050ff5abf3b6df1625a๋Š” Draft์ด๊ณ  exact-head CI/security๊ฐ€ ์•„์ง non-terminal์ด๋ฏ€๋กœ ๊ทธ๊ฒƒ ์—ญ์‹œ merge-ready๋กœ ๊ฐ„์ฃผํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Primary references:

๋”ฐ๋ผ์„œ #608์—๋Š” successor๋กœ ์Šน๊ณ„ํ•ด์•ผ ํ•  ๋…๋ฆฝ์ ์ธ ์œ ํšจ test/fixture/contract๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. false-positive security claim๊ณผ ๊ทธ claim๋งŒ ๊ฒ€์ฆํ•˜๋Š” source/test๋ฅผ ์ œ๊ฑฐํ•˜๋Š” ๊ฒƒ์ด ์˜ฌ๋ฐ”๋ฅธ ์ฒ˜๋ฆฌ์ด๋ฉฐ, ์‹ค์ œ DoS/OOM ๋ฌธ์ œ๋Š” #598์— ๊ธฐ๋ก๋œ ์ธก์ • ๊ฐ€๋Šฅํ•œ resource-budget Gap์—์„œ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

@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 Sep 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: Youโ€™ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 15091091-e966-4a18-82cd-6f06710da873

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 55b39b4 and 48d3d2d.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share

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

@devin-ai-integration devin-ai-integration 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.

โœ… Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@cwl-noema-review cwl-noema-review 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.

Noema LLM review

The PR adds a 4096-character length guard at the start of go() to mitigate DoS/OOM via oversized topDir inputs. The check is placed before any file-system access, includes a boundary-appropriate comparison, and is covered by a new test for 4097-character paths. No regressions were observed for normal-length paths.

Reviewed changed lines

  • src/main/kotlin/html4tree/main.kt:138 (RIGHT): The require(topDir.length <= 4096) guard runs before isNotBlank, traversal checks, File construction, and Files.isDirectory. This correctly blocks oversized inputs at the earliest point and prevents resource-intensive operations.
  • src/test/kotlin/html4tree/MainTest.kt:130 (RIGHT): The new test constructs a 4097-character path and asserts IllegalArgumentException, matching the intended behavior. It may reach other guards after the length check, but the failure still validates the new security control.
  • .jules/sentinel.md:102 (RIGHT): The sentinel note correctly documents the vulnerability, learning, and prevention guidance for bounded input length before expensive file-system operations.

Adversarial validation

  • src/main/kotlin/html4tree/main.kt:138 (RIGHT) falsified: A path of exactly 4096 characters is rejected by the new length check. โ€” The comparison uses <=, so exactly 4096 characters passes. Subsequent validation proceeds normally.
  • src/main/kotlin/html4tree/main.kt:138 (RIGHT) falsified: A path of 4097 characters reaches file-system operations before being rejected. โ€” The new require statement is the first line in go() and throws IllegalArgumentException immediately, before any file-system access.
  • src/main/kotlin/html4tree/main.kt:138 (RIGHT) falsified: The new guard breaks previously accepted normal-length paths. โ€” The check only rejects inputs longer than 4096 characters; normal short paths remain unaffected.
  • Residual risk: No concrete regression hypothesis was falsified by the probes; the length check is placed before all file-system calls and is covered by a boundary test.

Findings

  • No blocking findings.
  • Result: APPROVE
  • Head SHA: 48d3d2d7e745146d285f21f894ca409ef610a941
  • Reviewer credential: noema-review-github-app-refresh
  • Actor: cwl-noema-review[bot]

@seonghobae seonghobae closed this Sep 3, 2026
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