Skip to content

πŸ›‘οΈ Sentinel: [λ³΄μ•ˆ ν–₯상] ν”„λ‘œμ„ΈμŠ€ λ¬΄ν•œ λŒ€κΈ°λ₯Ό λ°©μ§€ν•˜κΈ° μœ„ν•œ μ„œλΈŒν”„λ‘œμ„ΈμŠ€ νƒ€μž„μ•„μ›ƒ 적용#201

Closed
seonghobae wants to merge 1 commit into
mainfrom
sentinel-subprocess-timeouts-14011911520658023623
Closed

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

🚨 심각도: MEDIUM

πŸ’‘ 취약점: media_shrinker.pyμ—μ„œ ffmpeg, ffprobe, brctl λ“± μ™ΈλΆ€ λ°”μ΄λ„ˆλ¦¬λ₯Ό μ‹€ν–‰ν•  λ•Œ subprocess.run ν•¨μˆ˜μ— timeout μΈμžκ°€ μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. 기본적으둜 subprocess.run은 μ™„λ£Œλ  λ•ŒκΉŒμ§€ λ¬΄ν•œμ • λŒ€κΈ°ν•˜λ―€λ‘œ, μ™ΈλΆ€ ν”„λ‘œμ„ΈμŠ€κ°€ μž…λ ₯ λŒ€κΈ° μƒνƒœμ— λΉ μ§€κ±°λ‚˜ λ„€νŠΈμ›Œν¬ 마운트 μ§€μ—° λ“±μœΌλ‘œ 멈좜 경우 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μŠ€λ ˆλ“œκ°€ 영ꡬ적으둜 차단될 수 μžˆμŠ΅λ‹ˆλ‹€.

🎯 영ν–₯: μ΄λŸ¬ν•œ ν”„λ‘œμ„ΈμŠ€ 멈좀 ν˜„μƒμ΄ λˆ„μ λ˜λ©΄ μ„œλ²„μ˜ μŠ€λ ˆλ“œ 및 λ©”λͺ¨λ¦¬ λ¦¬μ†ŒμŠ€κ°€ κ³ κ°ˆλ˜μ–΄ μ„œλΉ„μŠ€ κ±°λΆ€(DoS) μƒνƒœμ— 빠질 수 μžˆμŠ΅λ‹ˆλ‹€.

πŸ”§ ν•΄κ²°μ±…: λͺ¨λ“  subprocess.run ν˜ΈμΆœμ— μž‘μ—… νŠΉμ„±μ— λ§žλŠ” λͺ…μ‹œμ μΈ timeout 값을 μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.

  • λΉ λ₯Έ 메타데이터 확인 및 ν”„λ‘œλΈŒ(ffprobe, SetFile λ“±): 60초 μ œν•œ
  • λŒ€μš©λŸ‰ λ―Έλ””μ–΄ λ³€ν™˜ 및 λ‹€μš΄λ‘œλ“œ(ffmpeg, brctl): 3600초 μ œν•œ
  • μ‹œκ°„ 초과 λ°œμƒ μ‹œ subprocess.TimeoutExpired μ˜ˆμ™Έλ₯Ό μ•ˆμ „ν•˜κ²Œ ν¬μ°©ν•˜μ—¬ μ μ ˆν•œ 처리λ₯Ό μˆ˜ν–‰ν•˜λ„λ‘ κ΅¬ν˜„ν–ˆμŠ΅λ‹ˆλ‹€.

βœ… 확인 방법: λͺ¨λ“  ν…ŒμŠ€νŠΈκ°€ PYTHONPATH=. python3 -m pytest tests/λ₯Ό 톡해 μ„±κ³΅μ μœΌλ‘œ ν†΅κ³Όλ˜μ—ˆμŒμ„ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.


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

- `media_shrinker.py`의 λͺ¨λ“  `subprocess.run` 호좜(`ffmpeg`, `ffprobe`, `brctl` λ“±)에 λͺ…μ‹œμ μΈ `timeout` 인자 μΆ”κ°€
- μ™ΈλΆ€ ν”„λ‘œμ„ΈμŠ€κ°€ λ¬΄ν•œμ • λŒ€κΈ°ν•˜μ—¬ λ°œμƒν•  수 μžˆλŠ” λ¦¬μ†ŒμŠ€ 고갈 및 DoS(μ„œλΉ„μŠ€ κ±°λΆ€) μœ„ν—˜ λ°©μ§€
- μž‘μ—… νŠΉμ„±μ— 맞좘 μ œν•œ μ‹œκ°„ 적용 (λ‹¨μˆœ ν”„λ‘œλΈŒ/메타데이터: 60초, λ―Έλ””μ–΄ λ³€ν™˜/iCloud λ‹€μš΄λ‘œλ“œ: 3600초)
- `subprocess.TimeoutExpired` μ˜ˆμ™Έλ₯Ό μ•ˆμ „ν•˜κ²Œ ν¬μ°©ν•˜κ³  의미 μžˆλŠ” `MediaShrinkerError` λ°œμƒν•˜λ„λ‘ 처리
- Bandit λ“± λ³΄μ•ˆ μŠ€μΊλ„ˆμ˜ μ˜€νƒμ„ λ°©μ§€ν•˜κΈ° μœ„ν•œ `# nosec B603` 주석 μΆ”κ°€
@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.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Duplicate of #154 (approved, green): the same 'add subprocess timeout / fix DoS' change. Consolidating on #154; closing this duplicate.

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

Copy link
Copy Markdown

Duplicate of #154 (approved, green): the same 'add subprocess timeout / fix DoS' change. Consolidating on #154; closing this duplicate.

Understood. Acknowledging that this work is a duplicate 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