Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] PDF 검증 μ‹œ DoS 취약점 ν•΄κ²° - #720

Open
seonghobae wants to merge 1 commit into
developfrom
sentinel/fix-pdf-validation-dos-1724286447729843431
Open

πŸ›‘οΈ Sentinel: [CRITICAL] PDF 검증 μ‹œ DoS 취약점 ν•΄κ²°#720
seonghobae wants to merge 1 commit into
developfrom
sentinel/fix-pdf-validation-dos-1724286447729843431

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

🚨 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


Open in Devin Review

@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 Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ac55558f-0591-4b63-86d7-5d776844f009

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between e06b1f3 and c0e7af6.

πŸ“’ Files selected for processing (3)
  • .jules/sentinel.md
  • src/newsdom_api/main.py
  • tests/test_parse_endpoint.py

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 found 1 potential issue.

Open in Devin Review

Comment thread src/newsdom_api/main.py
Comment on lines +195 to 199
except Exception as exc:
LOGGER.error("Structural PDF validation failed", exc_info=exc)
raise HTTPException(
status_code=415,
detail=UNSUPPORTED_MEDIA_DETAIL,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ“ 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)

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

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