π‘οΈ Sentinel: [CRITICAL] PDF κ²μ¦ μ DoS μ·¨μ½μ ν΄κ²° - #720
π‘οΈ Sentinel: [CRITICAL] PDF κ²μ¦ μ DoS μ·¨μ½μ ν΄κ²°#720seonghobae wants to merge 1 commit into
Conversation
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedNext included review available in 10 minutes. View limit detailsLimit 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. Review configuration: βοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (3)
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. Comment |
| except Exception as exc: | ||
| LOGGER.error("Structural PDF validation failed", exc_info=exc) | ||
| raise HTTPException( | ||
| status_code=415, | ||
| detail=UNSUPPORTED_MEDIA_DETAIL, |
There was a problem hiding this comment.
π Info: Broad except does not mask HTTPException
Widening to except Exception in _validate_pdf_structure cannot swallow an HTTPException: the magic-byte 415 is raised before the try, and the only in-try raise is ValueError, already intended to become 415. All other structural failures now map to 415 as intended.
(Refers to this code)
Was this helpful? React with π or π to provide feedback.
π¨ Severity: CRITICAL
π‘ Vulnerability: ꡬ쑰μ κ²μ¦ λΌμ΄λΈλ¬λ¦¬(PdfReader)κ° μμλ νμΌμ λν΄ μμμΉ λͺ»ν μμΈ(μ:
MemoryError)λ₯Ό λμ§ λ μ²λ¦¬λμ§ μμ 500 μλ¬λ₯Ό μ λ°νμ¬ μ μ¬μ μΈ DoS μ·¨μ½μ μ λ°μμν¬ μ μμ΅λλ€.π― Impact: μ μμ μΈ μ¬μ©μκ° νΉμνκ² μ‘°μλ νμΌμ μ λ‘λνμ¬ μλ²μμ μ²λ¦¬λμ§ μμ μμΈλ₯Ό λ°μμν€κ³ μμμ μμ§νκ±°λ μλΉμ€λ₯Ό μ€λ¨μν¬ μ μμ΅λλ€.
π§ Fix:
_validate_pdf_structureμ μμΈ μ²λ¦¬λ₯Ό κ΄λ²μνExceptionμ μ‘λλ‘ λ³κ²½νμ¬ λͺ¨λ μμΈκ° μμ ν 415 μλ΅μΌλ‘ λ³νλλλ‘ μμ νκ³ , κ΄λ ¨ λ¬Έμ λ₯Ό κ°λ¦¬μ§ μλλ‘ λ‘κ·Έλ₯Ό λ¨κ²Όμ΅λλ€.β Verification: νΉμ μμΈ(
MemoryError)λ₯Ό κ°μ λ‘ λ°μμμΌ μ μ νκ² λ‘κ·Έλ₯Ό λ¨κΈ°κ³ μμ νκ² μ²λ¦¬λλμ§ νμΈνλ ν μ€νΈλ₯Ό μΆκ°νμ΅λλ€.PR created automatically by Jules for task 1724286447729843431 started by @seonghobae