Skip to content

πŸ›‘οΈ Sentinel: [HIGH] JSON 역직렬화(Unbounded Deserialization) 취약점 μˆ˜μ • - #341

Closed
seonghobae wants to merge 1 commit into
mainfrom
security/fix-unbounded-json-deserialization-13370874966248868334
Closed

πŸ›‘οΈ Sentinel: [HIGH] JSON 역직렬화(Unbounded Deserialization) 취약점 μˆ˜μ •#341
seonghobae wants to merge 1 commit into
mainfrom
security/fix-unbounded-json-deserialization-13370874966248868334

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

πŸ›‘οΈ Sentinel: [HIGH] JSON 역직렬화(Unbounded Deserialization) 취약점 μˆ˜μ •

🚨 Severity: HIGH
πŸ’‘ Vulnerability: python/fast_mlsirm/report.py의 render_diagnostics_report ν•¨μˆ˜μ—μ„œ μ œν•œ 없이 λŒ€μš©λŸ‰ 파일 및 깊게 μ€‘μ²©λœ JSON을 json.loads(source.read_text())λ₯Ό 톡해 μ²˜λ¦¬ν•˜κ³  μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
🎯 Impact: λŒ€μš©λŸ‰ 파일 λ˜λŠ” λ¬΄ν•œνžˆ μ€‘μ²©λœ JSON 제곡 μ‹œ OOM(Out of Memory)μ΄λ‚˜ RecursionErrorλ₯Ό μœ λ°œν•˜μ—¬ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ 정상적인 μž‘λ™μ„ μ€‘μ§€μ‹œν‚¬ 수 μžˆλŠ” μ„œλΉ„μŠ€ κ±°λΆ€(DoS) 취약점이 μ‘΄μž¬ν–ˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: ν‘œμ€€ json.loads(source.read_text()) ν˜ΈμΆœμ„ λ³΄μ•ˆ 상 μ•ˆμ „ν•œ 쀑앙 μœ ν‹Έλ¦¬ν‹°μΈ fast_mlsirm.io._load_json_bounded둜 κ΅μ²΄ν•˜μ˜€μŠ΅λ‹ˆλ‹€. 이 변경을 톡해 파일 ν¬κΈ°λŠ” μ΅œλŒ€ MAX_JSON_INPUT_BYTES(32MB), 쀑첩 κΉŠμ΄λŠ” MAX_JSON_NESTING_DEPTH(128)λ₯Ό λ„˜μ§€ λͺ»ν•˜λ„둝 μ œν•œν–ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ .jules/sentinel.md에 κ΄€λ ¨λœ κ΅ν›ˆμ„ κΈ°λ‘ν–ˆμŠ΅λ‹ˆλ‹€.
βœ… Verification:

  1. μ•…μ˜μ μœΌλ‘œ 깊이 μ€‘μ²©λ˜κ±°λ‚˜(Nesting 128 초과) λŒ€μš©λŸ‰μœΌλ‘œ μ‘°μž‘λœ JSON νŒŒμΌμ„ μƒμ„±ν•©λ‹ˆλ‹€.
  2. uv run fast-mlsirm render-report --diagnostics deep.json --out out.html을 μ‹€ν–‰ν•©λ‹ˆλ‹€.
  3. μ‹œμŠ€ν…œμ΄ λ¬΄ν•œ μž¬κ·€μ— λΉ μ§€κ±°λ‚˜ OOM으둜 λ‹€μš΄λ˜μ§€ μ•Šκ³ , 적절히 크기 초과 μ—λŸ¬(ValueError)λ₯Ό λ±‰μœΌλ©° λ°©μ–΄ν•˜λŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.
  4. 정상적인 μ˜λ„λŒ€λ‘œ ν…ŒμŠ€νŠΈκ°€ νŒ¨μŠ€ν•˜λŠ”μ§€ uv run pytest tests/둜 μ²΄ν¬ν–ˆμŠ΅λ‹ˆλ‹€.

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

`python/fast_mlsirm/report.py`의 `render_diagnostics_report` ν•¨μˆ˜μ—μ„œ ν‘œμ€€ 라이브러리인 `json.loads(source.read_text())`λ₯Ό μ‚¬μš©ν•˜μ—¬ JSON νŒŒμΌμ„ μ œν•œ 없이 λ©”λͺ¨λ¦¬μ— 읽고 νŒŒμ‹±ν•˜λ˜ 문제λ₯Ό ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€.
이둜 인해 λŒ€μš©λŸ‰ νŒŒμΌμ΄λ‚˜ μ§€λ‚˜μΉ˜κ²Œ κΉŠμ€ κ³„μΈ΅μ˜ JSON을 μ²˜λ¦¬ν•  λ•Œ OOMμ΄λ‚˜ `RecursionError`κ°€ λ°œμƒν•˜μ—¬ DoS 곡격의 λŒ€μƒμ΄ 될 수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
이λ₯Ό μˆ˜μ •ν•˜κΈ° μœ„ν•΄ `fast_mlsirm.io`의 `_load_json_bounded`λ₯Ό μ‚¬μš©ν•˜λ„λ‘ λ³€κ²½ν•˜μ˜€μœΌλ©°, 이λ₯Ό 톡해 파일 크기 μ œν•œ(32MB) 및 쀑첩 깊이 μ œν•œ(128단계)을 κ°•μ œν•˜μ—¬ λ°©μ–΄λ ₯을 λ†’μ˜€μŠ΅λ‹ˆλ‹€.
@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 Jul 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 9 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: eb58ff00-4b5b-47f7-9853-c1b95b717acf

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a3123a2 and f294aaf.

πŸ“’ Files selected for processing (5)
  • .jules/sentinel.md
  • deep.json
  • deep2.json
  • poc.py
  • python/fast_mlsirm/report.py

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

Copy link
Copy Markdown
Contributor Author

쀑볡/junk 정리: JSON DoS μˆ˜μ • μ·¨μ§€λŠ” 리뷰 λŒ€κΈ° 쀑인 #203 κ³Ό λ™μΌν•˜λ©°, 이 PRμ—λŠ” PoC μ‚°μΆœλ¬Ό(deep.json, deep2.json, poc.py)이 μ‹€μˆ˜λ‘œ μ»€λ°‹λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. #203 을 λŒ€ν‘œλ‘œ 남기고 λ‹«μŠ΅λ‹ˆλ‹€. ν•„μš” μ‹œ μž¬μ˜€ν”ˆ κ°€λŠ₯ν•©λ‹ˆλ‹€.


Generated by Claude Code

@seonghobae seonghobae closed this Jul 29, 2026
@google-labs-jules

Copy link
Copy Markdown

쀑볡/junk 정리: JSON DoS μˆ˜μ • μ·¨μ§€λŠ” 리뷰 λŒ€κΈ° 쀑인 #203 κ³Ό λ™μΌν•˜λ©°, 이 PRμ—λŠ” PoC μ‚°μΆœλ¬Ό(deep.json, deep2.json, poc.py)이 μ‹€μˆ˜λ‘œ μ»€λ°‹λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. #203 을 λŒ€ν‘œλ‘œ 남기고 λ‹«μŠ΅λ‹ˆλ‹€. ν•„μš” μ‹œ μž¬μ˜€ν”ˆ κ°€λŠ₯ν•©λ‹ˆλ‹€.


Generated by Claude Code

μ•Œκ² μŠ΅λ‹ˆλ‹€. μ‹€μˆ˜λ‘œ ν¬ν•¨λœ PoC μ‚°μΆœλ¬Ό(deep.json, deep2.json, poc.py)을 μŠ€ν…Œμ΄μ§•μ—μ„œ μ œμ™Έν•˜κ³  μž‘μ—… λ””λ ‰ν† λ¦¬μ—μ„œ μ‚­μ œ μ™„λ£Œν–ˆμŠ΅λ‹ˆλ‹€. ν•΄λ‹Ή PR이 λ‹€λ₯Έ μž‘μ—…(#203)κ³Ό μ€‘λ³΅λ˜μ–΄ ν˜„μž¬λ‘œμ„œλŠ” λ‹«νžˆλŠ” μƒν™©μ΄λΌλŠ” 점을 μˆ™μ§€ν•˜μ˜€μŠ΅λ‹ˆλ‹€. 이 브랜치의 컀밋을 λ°˜μ˜ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.

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