Skip to content

fix(api): bound language and mode form values - #991

Draft
seonghobae wants to merge 9 commits into
developfrom
jules-1286401567880982473-e7e08600
Draft

seonghobae wants to merge 9 commits into
developfrom
jules-1286401567880982473-e7e08600

Conversation

@seonghobae

@seonghobae seonghobae commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

상태

  • lifecycle: Draft / Proposed API input-bound contract
  • exact head: de5df7ed06f5effc17971fbfdcfb1d37905904ae
  • base: develop@539528f9667524f6b65de0ee7b8b21fbdd97c380

유효 delta

language와 mode form value를 50자로 제한하고 두 필드의 51자 입력이 422 string_too_long으로 거부되는 regression을 보존합니다. 이는 multipart parsing 이후의 application contract이며 multipart request-body memory exhaustion 방지를 입증하지 않습니다.

정확한 현재 evidence

Tests 36933284429, repository CodeQL 36933285163, Semgrep 36933284355, container 36933284346, Scorecard 36933284342, ClusterFuzzLite 36933284387: GREEN. Security 36933284495: RED. CodeQL PR 36933284372: queued. 이전 본문의 exact head 18c7cd2...와 run ID는 stale이므로 승계하지 않습니다.

Repository dependency-security owner는 #822 current exact 23e481577af0283da512d9b2626ae27188245bdc입니다. 이 input-bound leaf에 lock/dependency delta를 복제하지 않습니다. #822 통합 후 재기준화하고 unchanged exact head의 모든 required gates와 review가 terminal일 때만 Ready로 전환합니다.

@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 Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: ContextualWisdomLab/newsdom-api/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9fd3e35c-27e2-4f55-90c4-d77da24967f5

📥 Commits

Reviewing files that changed from the base of the PR and between 539528f and 18c7cd2.

📒 Files selected for processing (2)
  • src/newsdom_api/main.py
  • tests/test_parse_endpoint.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

parse의 language 및 mode 폼 필드에 각각 50자 제한을 추가했습니다. 새 테스트는 두 필드에 51자를 전달할 때 422 응답과 string_too_long 오류를 확인합니다.

Changes

parse 입력 검증

Layer / File(s) Summary
필드 길이 제한 및 검증 테스트
src/newsdom_api/main.py, tests/test_parse_endpoint.py
language와 mode 폼 필드에 최대 50자 제한을 설정했습니다. 테스트는 각 필드에 51자를 입력했을 때 422 응답과 string_too_long 오류를 확인합니다.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to de5df

The parse endpoint now rejects language and mode values longer than 50 characters with a validation error, and tests cover that rejection. Shorter values follow the same path as before. This limit does not cap total request size by itself, so any overall request-size limit must still come from server or proxy settings, as it did before this change. No merge-blocking issue was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 18c7c

The change narrows accepted input without increasing privileges or exposure. However, these field limits do not by themselves establish protection against large-request memory exhaustion, and effective production request-size limits remain unconfirmed.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The unresolved resource-exhaustion question concerns the runtime serving /parse. The change adds no route, authority, or downstream destination. Production replica, shared-host, and tenant exposure are not established by the available evidence.

Security Findings and Attack Paths

  • inferred — The DoS candidate remains deferred because effective deployed request limits are unknown. The relevant authorization and upload controls predate this PR and remain unchanged; no verified attack path introduced or worsened by this change was established.

Trust Boundaries and Controls

  • observed — When authentication is enabled, middleware checks bearer credentials before body processing and rejects invalid credentials. An explicit disabled-authentication mode bypasses that check. Existing upload-size enforcement operates inside the handler after multipart parsing, so it is not evidence of an earlier total-body limit.

Hardening Proposals

  • proposed — Verify and document the deployed multipart per-part safeguards and total request-body limits. If they do not provide the intended resource boundary, add an early body-size control rather than treating post-parsing field validation as equivalent protection.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 제목은 language 및 mode form 값의 길이 제한 변경을 간결하고 정확하게 설명합니다.
Description check ✅ Passed 설명은 변경 목적, 검증 결과, base 브랜치, 보안 게이트 상태와 후속 조건을 구체적으로 포함합니다. 템플릿의 일부 제목과 체크박스 형식은 없지만 필수 정보는 대부분 다른 섹션에 포함되어 있습니다.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@seonghobae seonghobae changed the title 🛡️ Sentinel: [MEDIUM] FastAPI Form 필드 최대 길이 제한 적용 fix(api): bound language and mode form values Oct 1, 2026
@seonghobae seonghobae added bug Something isn't working type: bug Defect or incorrect behavior priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks area: api API, protocol, event, or external contract area: security Security boundary, hardening, or vulnerability prevention labels Oct 1, 2026 — with ChatGPT Codex Connector
@seonghobae
seonghobae marked this pull request as draft October 1, 2026 22:25
@seonghobae seonghobae removed the status: needs-review Open pull request requiring current-head review or checks label Oct 1, 2026
@seonghobae seonghobae added the status: draft Draft pull request label Oct 1, 2026 — with ChatGPT Codex Connector

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api API, protocol, event, or external contract area: security Security boundary, hardening, or vulnerability prevention bug Something isn't working priority: medium Normal-priority or P2 work status: draft Draft pull request type: bug Defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant