fix: remediate 19 trivy-fs CVEs at the develop base + map non-list MinerU JSON to 502 - #464
fix: remediate 19 trivy-fs CVEs at the develop base + map non-list MinerU JSON to 502#464seonghobae wants to merge 5 commits into
Conversation
The central Security Scan `trivy-fs` gate fails on `develop` with 19 CRITICAL/HIGH/MEDIUM findings (`ignore-unfixed: true`), blocking every open PR since they inherit the base lock. Remediate at base: - pillow 12.2.0 -> 12.3.0 (CVE-2026-54058/54059/54060/55379/55380/59197/ 59198/59199/59200/59203/59204/59205/55798 — 13 findings) - pypdf 6.13.3 -> 6.14.2 (CVE-2026-59935/59936/59937/59938 — 4 findings) - setuptools 81.0.0 -> 83.0.0 (CVE-2026-59890) All within the existing pyproject ranges (`Pillow>=11.0,<13.0`, `pypdf>=6.13.3,<7.0`); `uv lock --check` clean, full test suite passes (430). The one remaining finding, CVE-2026-61632 in pymdown-extensions (< 11.0.1), is a docs-build-only transitive dependency (via mkdocs-material) that never ships in the API image or runtime. Its fix requires mkdocs-material >= 9.7, which the repo deliberately avoids — test_docs_theme_range_stays_below_warning_release pins mkdocs-material < 9.7 to keep the "mkdocs 2.0" deprecation banner out of `mkdocs build --strict`. It is therefore recorded as a documented, time-boxed accepted-risk suppression in `.trivyignore` (MEDIUM 5.3), satisfying the existing suppression contract test, with a revisit condition. Not a gate weakening: HIGH/CRITICAL and all runtime-facing findings are fixed, not ignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
|
Warning Review limit reached
Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
📝 WalkthroughWalkthrough문서 빌드 전용 ChangesTrivy 억제 업데이트
Estimated code review effort: 1 (단순) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.trivyignore:
- Around line 31-33: .trivyignore의 CVE-2026-61632 억제 항목에 명시적인 승인 만료 또는 재검토 날짜를
추가하세요. 기존 mkdocs-material 9.7+ 채택 및 pymdown-extensions 백포트 조건은 유지하되, upstream
변경이 없더라도 해당 날짜에 재검토되도록 주석을 업데이트하세요.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ddecc0e2-9353-435e-9bcd-b7cfe6ab5788
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
.trivyignore
…ession Address review feedback: the accepted-risk .trivyignore entry claimed to be time-boxed but only had upstream-conditional revisit triggers, so a stalled upstream could keep it indefinitely. Add an explicit "Revisit by 2026-10-31" date (matching the DS-0002 horizon) while keeping the mkdocs-material 9.7+ / pymdown-extensions backport conditions. Suppression-contract test still passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
…e-output error
_parse_mineru_output read the content-list and model JSON artifacts but
never validated their top-level shape, so a syntactically valid MinerU
output that is not a JSON array (e.g. {} or a bare string) slipped
through and failed downstream in dom_builder as an unhandled 500 —
violating the documented contract that incomplete MinerU output maps to
502. Validate that both artifacts deserialize to lists and raise the
typed, sanitized MineruIncompleteOutputError (no path leakage) otherwise.
Tests: parametrized non-list content-list and model cases mirroring the
existing malformed-JSON path tests. Full suite 432 passed; branch
coverage 100% over src/newsdom_api.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
…der fuzzer MinerU output whose content_list/model is a list but contains a non-dict member reached build_dom, where _group_blocks_by_page_idx / _extract_page_info_by_idx call .get() on each member and raised AttributeError -> unhandled 500, instead of the documented 502 incomplete-output contract. - mineru_runner._parse_mineru_output now rejects a non-object content block or model page entry with MineruIncompleteOutputError (-> 502), alongside the existing not-a-list checks. - build_dom self-defends: a non-object block raises its documented benign ValueError (honouring the list[dict] contract for direct callers/fuzzing). - The dom_builder fuzzer no longer pre-strips non-dict members in _coerce_content_list (which masked this gap) and tolerates build_dom's benign ValueError, so the boundary is actually fuzzed. Tests: runner non-object block/entry cases; build_dom non-dict block case. Full gate: 435 passed, 100% branch coverage, warnings-as-errors clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
click <=8.3.2 has a command-injection in click.edit() (CVE-2026-7246 / PYSEC-2026-2132, HIGH) — an attacker-controlled editor value can pass arbitrary OS commands. click is a transitive dependency here (via uvicorn/typer); the app never imports it directly. `uv lock --upgrade-package click` resolves the latest compatible 8.4.2 (well past the 8.3.3 fix), a minimal 3-line lock change. Verified against the strict CI gate: uv export + pip-audit → clean; PYTHONWARNINGS=error pytest with --cov-branch --cov-fail-under=100 → 435 passed, 100% branch coverage, no new warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
1. Security: remediate 19
trivy-fsCVEs inuv.lockat the develop baseThe central Security Scan
trivy-fsgate fails ondevelopwith 19 CRITICAL/HIGH/MEDIUM findings (ignore-unfixed: true), and because every open PR inherits the baseuv.lock, this blocks the whole repo's PR queue. Remediated at the shared base:All within the existing
pyproject.tomlranges (Pillow>=11.0,<13.0,pypdf>=6.13.3,<7.0) —pyproject.tomlis unchanged; onlyuv.lockmoved.The one remaining finding, CVE-2026-61632 in
pymdown-extensions (<11.0.1), is a docs-build-only transitive dep (viamkdocs-material) that never ships in the API image or runtime. Its fix needsmkdocs-material >= 9.7, which the repo deliberately avoids (test_docs_theme_range_stays_below_warning_releasepinsmkdocs-material < 9.7to keep the "mkdocs 2.0" deprecation banner out ofmkdocs build --strict). It is recorded as a documented, time-boxed accepted-risk.trivyignoreentry (MEDIUM 5.3) with a revisit date, satisfying the suppression-contract test. HIGH/CRITICAL and all runtime-facing findings are fixed, not ignored — the gate is not weakened.2. Correctness: map non-list MinerU JSON to the documented 502
_parse_mineru_outputread the content-list and model JSON artifacts but never validated their top-level shape, so a syntactically valid MinerU output that is not a JSON array (e.g.{}or a bare string) slipped through and failed downstream indom_builderas an unhandled 500 — violating the documented contract that incomplete MinerU output maps to 502. The fix validates that both artifacts deserialize to lists and raises the typed, sanitizedMineruIncompleteOutputError(no path leakage) otherwise. Added parametrized non-list content-list and model tests mirroring the existing malformed-JSON path tests.Git Flow target
fix/*→develop. No release/hotfix back-merge needed.Verification
PYTHONWARNINGS=error uv run pytest -m "not integration" --cov=src/newsdom_api --cov-branch --cov-fail-under=100→ 432 passed, 100% branch coverageuv lock --check→ clean (lock consistent with pyproject)uv run mkdocs build --strict→ passes on the retainedmkdocs-material 9.6.23pillow/pypdf/setuptoolsconfirmed bumped inuv.lock;pyproject.tomlnet-unchangedNotes
.trivyignorevia its default--ignorefile, so the single documented entry clears the residual docs-only MEDIUM.coverage-evidencesandbox now reports success on this PR's head, so the earlier cross-repo gate note is resolved.🤖 Generated with Claude Code
https://claude.ai/code/session_01HdCssGnNMhKHNu3TXFstWH
Generated by Claude Code