Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] 파일 νŒŒμ‹± 쀑 λ°œμƒν•˜λŠ” μ²˜λ¦¬λ˜μ§€ μ•Šμ€ μ˜ˆμ™Έλ‘œ μΈν•œ DoS 취약점 μˆ˜μ • - #770

Draft
seonghobae wants to merge 4 commits into
fix-dos-pdfreader-15818172746879872593from
sentinel-fix-pdfreader-unhandled-exceptions-5700968996439877863
Draft

πŸ›‘οΈ Sentinel: [CRITICAL] 파일 νŒŒμ‹± 쀑 λ°œμƒν•˜λŠ” μ²˜λ¦¬λ˜μ§€ μ•Šμ€ μ˜ˆμ™Έλ‘œ μΈν•œ DoS 취약점 μˆ˜μ •#770
seonghobae wants to merge 4 commits into
fix-dos-pdfreader-15818172746879872593from
sentinel-fix-pdfreader-unhandled-exceptions-5700968996439877863

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Current repair state β€” 2026-09-05

This Draft is now a narrow endpoint-regression child of parser-classification owner #677.

Repair applied

The prior branch carried three invalid competing deltas: a broad except Exception β†’ 415 production rule, generated Sentinel doctrine promoting that rule, and a regex spelling change in mineru_runner.py that did not change newline matching. Those are removed from the effective child tree by an ordinary two-parent merge that adopts #677 as the canonical prerequisite without rewriting either history.

The only intended unique delta is a focused public-endpoint regression. It injects TypeError from PdfReader through /parse, uses an explicit development/auth-disabled RuntimeSettings instance rather than ambient credentials, and requires sanitized 415 Unsupported Media Type plus the standard nosniff / DENY security headers. The production parser-classification rule remains wholly owned by #677.

#677 remains mutable prerequisite evidence until it integrates normally; this child does not treat its head as released product authority.

Promotion gate

Re-read #677 before every promotion. After #677 reaches protected develop, retarget this child to protected develop without force rewriting, prove the effective diff still contains only the endpoint regression, and reacquire all then-live exact-head repository/central tests, security, coverage, semantic-review/thread and qualifying independent approval gates. Predecessor checks/reviews do not transfer.

No self-approval, bypass, no-op retrigger, force-push, destructive rebase, gate weakening, regex/security-doctrine duplication, or competing production ownership.

@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 31, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 1 potential issue.

Devin Review

Comment thread src/newsdom_api/main.py Outdated
if len(reader.pages) < 1:
raise ValueError("PDF has no pages")
except (PdfReadError, RecursionError, ValueError, OverflowError):
except Exception as exc:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸŸ₯ λ©”λͺ¨λ¦¬ 고갈 μ˜ˆμ™Έκ°€ 계속 μ „νŒŒλ¨

μ‘°μž‘λœ PDFμ—μ„œ PdfReaderκ°€ MemoryErrorλ₯Ό λ‚΄λ©΄ except Exception은 이λ₯Ό μž‘μ§€ λͺ»ν•©λ‹ˆλ‹€. μš”μ²­μ΄ 415둜 μ’…λ£Œλ˜μ§€ μ•Šμ•„ μž‘μ—… ν”„λ‘œμ„ΈμŠ€κ°€ 쀑단될 수 μžˆμŠ΅λ‹ˆλ‹€.

Devin Review

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

@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.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 3 new potential issues.

Devin Review

Comment thread fix.patch Outdated
Comment thread src/newsdom_api/mineru_runner.py Outdated
# ⚑ Bolt: Use a pre-compiled regex to push pattern matching to C,
# avoiding the Python-level overhead of `any()` and generator comprehensions
_UNSAFE_CHARS_PATTERN = re.compile(r"[\0&;|`$<>\n\r]")
_UNSAFE_CHARS_PATTERN = re.compile(r"[\0&;|`$<\>\n\r]")

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

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

Comment thread .jules/sentinel.md Outdated
Comment on lines +94 to +97
## 2025-05-18 - [CRITICAL] Prevent DoS via Unhandled PdfReader Exceptions
**Vulnerability:** μ•…μ˜μ μΈ νŽ˜μ΄λ‘œλ“œ μ—…λ‘œλ“œ μ‹œ `PdfReader`μ—μ„œ λ°œμƒν•˜λŠ” `TypeError` λ˜λŠ” `MemoryError` λ“± μ²˜λ¦¬λ˜μ§€ μ•Šμ€ μ˜ˆμ™Έλ‘œ 인해 500 μƒνƒœ μ½”λ“œ 및 μ„œλ²„ λ¦¬μ†ŒμŠ€ μ†Œμ§„ 유발 κ°€λŠ₯μ„± 발견.
**Learning:** `PdfReader`λŠ” μ†μƒλ˜κ±°λ‚˜ νŠΉμˆ˜ν•˜κ²Œ μ‘°μž‘λœ PDF 파일 νŒŒμ‹± μ‹œ λ‹€μ–‘ν•œ ν˜•νƒœμ˜ λ‚΄μž₯ μ˜ˆμ™Έ(built-in exceptions)λ₯Ό 던질 수 있으며, 이λ₯Ό νŠΉμ • μ˜ˆμ™Έλ‘œλ§Œ μž‘μ„ 경우 μ˜ˆμƒμΉ˜ λͺ»ν•œ μ‹œμŠ€ν…œ μž₯μ• (DoS)둜 μ΄μ–΄μ§ˆ 수 있음.
**Prevention:** `_validate_pdf_structure` λ‚΄λΆ€μ—μ„œ `Exception`을 ν¬κ΄„μ μœΌλ‘œ μž‘μ•„λ‚΄μ–΄ 415 μƒνƒœ μ½”λ“œλ‘œ μ•ˆμ „ν•˜κ²Œ 처리(fail securely)ν•˜κ³ , 둜거(logger)λ₯Ό 톡해 μ˜ˆμ™Έ 정보λ₯Ό 남겨 좔적성을 μœ μ§€ν•¨.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ” 연ꡬ κ·Όκ±° λˆ„λ½

PDF 검증 변경에 μš”κ΅¬λ˜λŠ” λ…Όλ¬Έ PDFλ‚˜ λŒ€μ²΄ μΈμš©Β·μš”μ•½μ΄ μ—†λ‹€. 쑰직의 연ꡬ κ·Όκ±° 정책을 μΆ©μ‘±ν•˜μ§€ λͺ»ν•œλ‹€.

Devin Review

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

@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 new potential issue.

Devin Review

Comment thread src/newsdom_api/mineru_runner.py Outdated
# ⚑ Bolt: Use a pre-compiled regex to push pattern matching to C,
# avoiding the Python-level overhead of `any()` and generator comprehensions
_UNSAFE_CHARS_PATTERN = re.compile(r"[\0&;|`$<>\n\r]")
_UNSAFE_CHARS_PATTERN = re.compile(r"[\0&;|`$<\>\n\r]")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ” 독립적인 μˆ˜μ •μ΄ ν•œ PR에 ν˜Όν•©λ¨

PDF μ˜ˆμ™Έ μ²˜λ¦¬μ™€ MinerU μ •κ·œμ‹ 변경은 λ³„κ°œ 원인ꡰ이닀. MECE λ²”μœ„ κ·œμΉ™μ— 따라 μ •κ·œμ‹ λ³€κ²½κ³Ό κ΄€λ ¨ 기둝을 뢄리해야 ν•œλ‹€.

Devin Review

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

@seonghobae
seonghobae marked this pull request as draft September 5, 2026 07:44
@seonghobae
seonghobae changed the base branch from develop to fix-dos-pdfreader-15818172746879872593 September 5, 2026 07:59
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