security(api): reject non-text controls in multiline SQL - #832
security(api): reject non-text controls in multiline SQL#832seonghobae wants to merge 6 commits into
Conversation
|
Warning Review limit reached
Next review available in: 20 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesSQL 전송 보안
기존 동작 회귀 검증
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant FastAPI
participant ApplySqlIn
participant redact_request_validation_input
Client->>FastAPI: /apply-sql 요청
FastAPI->>ApplySqlIn: sql 필드 검증
ApplySqlIn-->>FastAPI: ValidationError
FastAPI->>redact_request_validation_input: RequestValidationError 전달
redact_request_validation_input-->>Client: 입력값이 제거된 422 응답
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/security/apply-sql-transport-validation.md (1)
35-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win문헌별 근거 요약을 추가하십시오.
현재 References에는 인용과 링크가 있지만 각 문헌이 어떤 검증 경계를 뒷받침하는지 설명이 없습니다. 각 참조 아래에 이 PR의 JSON transport, PostgreSQL lexical 처리, 또는 Unicode control-character 분류와의 관련성을 한 문장으로 추가하십시오.
As per coding guidelines, substantive pull requests must provide relevant citations, links, and summaries when permissible paper PDFs are not attached.
🤖 Prompt for 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. In `@docs/security/apply-sql-transport-validation.md` around lines 35 - 45, 각 참고문헌 항목 아래에 해당 자료가 뒷받침하는 검증 경계를 한 문장으로 요약하십시오. Bray의 RFC 8259는 JSON transport 검증, PostgreSQL 문헌은 lexical 처리, Unicode 표준은 control-character 분류와 연결되도록 작성하고 기존 인용 및 링크는 유지하십시오.Source: Coding guidelines
🤖 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 `@backend/tests/test_api_connections.py`:
- Around line 192-200: Ruff S105를 피하도록 테스트의 하드코딩된 비밀번호 marker를 여러 비밀이 아닌 문자열
조각으로 분리하십시오. test_api_connections의 해당 테스트에서 조각을 결합해 SQL의 credential 기본값을 만들고,
동일한 결합 값을 응답 및 로그 비노출 assertion에 재사용하십시오.
In `@backend/tests/test_pooler.py`:
- Around line 41-47: Update the test input surrounding the DSN construction so
the PostgreSQL URL is assembled at runtime from non-sensitive components rather
than committed as a full DSN containing credentials and connection details.
Remove the hardcoded password literal and the `# noqa: S105` suppression while
preserving the existing DSN and password assertions.
---
Nitpick comments:
In `@docs/security/apply-sql-transport-validation.md`:
- Around line 35-45: 각 참고문헌 항목 아래에 해당 자료가 뒷받침하는 검증 경계를 한 문장으로 요약하십시오. Bray의 RFC
8259는 JSON transport 검증, PostgreSQL 문헌은 lexical 처리, Unicode 표준은
control-character 분류와 연결되도록 작성하고 기존 인용 및 링크는 유지하십시오.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5386a4d2-f966-40fa-838e-100bbbdae878
📒 Files selected for processing (9)
CHANGELOG.mdbackend/app/main.pybackend/app/schemas.pybackend/tests/test_api_connections.pybackend/tests/test_permissions.pybackend/tests/test_pooler.pybackend/tests/test_schema_validation.pybackend/tests/test_security_headers.pydocs/security/apply-sql-transport-validation.md
Summary
ApplySqlInrequest-schema boundary while preserving tab, LF, CR, Unicode, and the existing size limitTest-first evidence
102 passedfor schema and connection API tests474 passed, 1 skipped100.00%(414statements,64branches)Success: no issues found in 68 source filesgit diff --check: cleanNo dependency, lockfile, database migration, frontend, or workflow changes.
Closes #764
Summary by CodeRabbit