security(backend): reject control characters in identifier fields - #699
security(backend): reject control characters in identifier fields#699seonghobae wants to merge 11 commits into
Conversation
schema.py 내 `DiagramViewCreateIn.name`, `TableAnnotationUpsertIn.schema_name`, `TableAnnotationUpsertIn.relation_name`, `ApiKeyCreateIn.key_name` 등 주요 Pydantic 입력 필드에 ASCII 제어 문자(0x00-0x1F, 0x7F)를 차단하는 정규식(`pattern=r"^[^\x00-\x1F\x7F]+$"`)을 추가했습니다. 이를 통해 로그 인젝션(Log Forging) 및 다운스트림 파싱 시 발생할 수 있는 취약점을 사전에 방지합니다.
|
👋 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. |
|
Warning Review limit reached
Next review available in: 40 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Comment |
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current headc8576ae074d3a093347b4e6b58cabc990cac6b06. -
Head SHA:
c8576ae074d3a093347b4e6b58cabc990cac6b06 -
Workflow run: 30726762909
-
Workflow attempt: 1
Coverage evidence
Coverage Decision
- Result: FAIL
- Test evidence: not proven passing
- Docstring evidence: not proven passing when configured
- Failure count: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file: sentinel.md"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file: sentinel.md"]
R1 --> V1["required checks"]
Evidence --> S2["Backend: schemas.py"]
S2 --> I2["API and service runtime"]
I2 --> R2["Review risk: Backend: schemas.py"]
R2 --> V2["backend tests"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage Decision
Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file: sentinel.md"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file: sentinel.md"]
R1 --> V1["required checks"]
Evidence --> S2["Backend (2 files)"]
S2 --> I2["API and service runtime"]
I2 --> R2["Review risk: Backend (2 files)"]
R2 --> V2["backend tests"]
|
|
@jules Please add a focused follow-up commit before merge:
|
요청하신 대로 백엔드 유닛 테스트를 추가하고 모든 요구사항을 반영했습니다:
|
schema.py 내 `DiagramViewCreateIn.name`, `TableAnnotationUpsertIn.schema_name`, `TableAnnotationUpsertIn.relation_name`, `ApiKeyCreateIn.key_name` 등 주요 Pydantic 입력 필드에 ASCII 제어 문자(0x00-0x1F, 0x7F)를 차단하는 정규식(`pattern=r"^[^\x00-\x1F\x7F]+$"`)을 추가했습니다. 관련 테스트를 작성하여 유니코드 문자는 정상 허용되고 제어 문자는 차단되며, `body` 같은 다중 라인 필드는 영향을 받지 않음을 검증했습니다.
|
@jules One small test defect remains: the |
코드 리뷰를 반영하여 테스트 스위트의 결함을 수정했습니다.
이 수정과 함께 백엔드 포맷팅( |
schema.py 내 `DiagramViewCreateIn.name`, `TableAnnotationUpsertIn.schema_name`, `TableAnnotationUpsertIn.relation_name`, `ApiKeyCreateIn.key_name` 등 주요 Pydantic 입력 필드에 ASCII 제어 문자(0x00-0x1F, 0x7F)를 차단하는 정규식(`pattern=r"^[^\x00-\x1F\x7F]+$"`)을 추가했습니다. 관련 테스트를 작성하여 유니코드 문자는 정상 허용되고 제어 문자는 차단되며, `body` 같은 다중 라인 필드는 영향을 받지 않음을 검증했습니다. 매개변수형 테스트 위치 지정 포맷 또한 리뷰 피드백을 수용하여 명확히 수정되었습니다.
Pull request was converted to draft
|
@coderabbitai review |
✅ Action performedReview finished.
|
Pull request was converted to draft
schema.py 내 `DiagramViewCreateIn.name`, `TableAnnotationUpsertIn.schema_name`, `TableAnnotationUpsertIn.relation_name`, `ApiKeyCreateIn.key_name` 등 주요 Pydantic 입력 필드에 ASCII 제어 문자(0x00-0x1F, 0x7F)를 차단하는 정규식(`pattern=r"^[^\x00-\x1F\x7F]+$"`)을 추가했습니다. 관련 테스트를 작성하여 유니코드 문자는 정상 허용되고 제어 문자는 차단되며, `body` 같은 다중 라인 필드는 영향을 받지 않음을 검증했습니다. 매개변수형 테스트 위치 지정 포맷 또한 리뷰 피드백을 수용하여 명확히 수정되었습니다. 또한 `검색 결과가 없습니다`라는 한국어 텍스트가 여러 노드에 걸쳐 분리되어 렌더링될 때 발생하는 프론트엔드 `App.coverage.test.tsx`의 TestingLibraryElementError 결함을 텍스트 매처 함수를 사용해 수정하여 CI 에러를 해결했습니다.
|
@opencode-agent @cwl-noema-review Please independently review exact current head |
|
@opencode-agent Please review exact current head |
|
@cwl-noema-review Please independently review exact current head |
|
@opencode-agent @cwl-noema-review Please independently review exact current head |
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head0a35203a0093b237ff1141a6da297a470e4069bc. -
Head SHA:
0a35203a0093b237ff1141a6da297a470e4069bc -
Workflow run: 30956424971
-
Workflow attempt: 1
Coverage evidence
Coverage Decision
- Result: FAIL
- Test evidence: not proven passing
- Docstring evidence: not proven passing when configured
- Failure count: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file: sentinel.md"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file: sentinel.md"]
R1 --> V1["required checks"]
Evidence --> S2["Backend (2 files)"]
S2 --> I2["API and service runtime"]
I2 --> R2["Review risk: Backend (2 files)"]
R2 --> V2["backend tests"]
|
@opencode-agent Please re-review exact current head |
|
@cwl-noema-review Please independently review exact current head |
Risk
Several user-controlled identifier and display-name fields accepted ASCII control characters, including CR, LF, NUL, terminal escapes, and DEL. Those values can corrupt logs, terminal output, line-oriented exports, or downstream parsers even when length constraints are present.
Change
Apply the existing printable-string policy to:
DiagramViewCreateIn.nameTableAnnotationUpsertIn.schema_nameTableAnnotationUpsertIn.relation_nameApiKeyCreateIn.key_nameThe annotation body remains intentionally multiline and is not subject to identifier validation.
Regression coverage
U+0000throughU+001F) andU+007Fat the beginning, middle, and end of every hardened field.The required current-head backend workflow must install the hash-locked environment and pass mypy, the complete pytest suite, and 100% coverage before merge.
Originally created by Jules for task 2205565764161335825.