π‘οΈ Sentinel: [CRITICAL] νμΌ νμ± μ€ λ°μνλ μ²λ¦¬λμ§ μμ μμΈλ‘ μΈν DoS μ·¨μ½μ μμ - #770
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. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
| if len(reader.pages) < 1: | ||
| raise ValueError("PDF has no pages") | ||
| except (PdfReadError, RecursionError, ValueError, OverflowError): | ||
| except Exception as exc: |
There was a problem hiding this comment.
π₯ λ©λͺ¨λ¦¬ κ³ κ° μμΈκ° κ³μ μ νλ¨
μ‘°μλ PDFμμ PdfReaderκ° MemoryErrorλ₯Ό λ΄λ©΄ except Exceptionμ μ΄λ₯Ό μ‘μ§ λͺ»ν©λλ€. μμ²μ΄ 415λ‘ μ’
λ£λμ§ μμ μμ
νλ‘μΈμ€κ° μ€λ¨λ μ μμ΅λλ€.
Was this helpful? React with π or π to provide feedback.
| # β‘ 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]") |
| ## 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)λ₯Ό ν΅ν΄ μμΈ μ 보λ₯Ό λ¨κ²¨ μΆμ μ±μ μ μ§ν¨. |
| # β‘ 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]") |
There was a problem hiding this comment.
Current repair state β 2026-09-05
This Draft is now a narrow endpoint-regression child of parser-classification owner #677.
fix-dos-pdfreader-15818172746879872593@71272c2c09f7fc6efe98a5dbfcb8ad787663db23b05c485a9a3dc596b4007b46cc8f07e4112a76d8Repair 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 inmineru_runner.pythat 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
TypeErrorfromPdfReaderthrough/parse, uses an explicit development/auth-disabledRuntimeSettingsinstance rather than ambient credentials, and requires sanitized415 Unsupported Media Typeplus the standardnosniff/DENYsecurity 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 protecteddevelopwithout 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.