Skip to content

fix(collab): sanitize Redis configuration errors - #333

Merged
isac322 merged 1 commit into
mainfrom
fix/redis-error-diagnostics
Nov 3, 2026
Merged

isac322 merged 1 commit into
mainfrom
fix/redis-error-diagnostics

Conversation

@isac322

@isac322 isac322 commented Nov 3, 2026

Copy link
Copy Markdown
Member

TL;DR

  • Reject invalid Redis settings without echoing configuration values.
  • Keep startup rejection and normal Redis relay connections unchanged.

Root cause

The Redis URL parser can include input values in its error. Returning that error from ConnectCollab passed those values to the CLI diagnostic. This was found during pre-release validation and is a user-requested fix; there is no separate linked issue.

Changes

  • Return a fixed configuration error for every Redis URL parsing failure.
  • Add seven cases covering malformed settings, confidential values in option errors, and existing safe rejection controls.
  • Add the user-visible fix to the changelog.

QA

Contract Coverage
Invalid settings are rejected without exposing input values TestConnectCollabRedisParseErrorOmitsSecrets
Normal Redis relay setup still converges across two servers Existing TestCollabProcessesConvergeOverRedis
No Redis setting still allows normal startup Installed CLI serve smoke
CLI diagnostics preserve rejection without exposing configuration Same malformed inputs against pre-fix and fixed installed archives

Verification

Head: 2d797f0f4a62ba6ab09525bfcffe1bd5a8728bbc.

  • go test ./... -count=1 -timeout=45m: passed.
  • go vet ./... and go build ./...: passed.
  • Webapp race checks for collab, concurrent, stress, events, presence, upload, and store paths: passed.
  • PostgreSQL-backed webapp suite against PostgreSQL 16: passed.
  • The v0.18.1 test suite against this runtime: passed.
  • Four-platform GoReleaser snapshot and archive checksums: passed.
  • Clean archive installation and two runs of the real CLI sync/viewer/upload/shutdown smoke: passed. Matching-source MCP OAuth/SDK checks also passed.

Same final regression tests, with the pre-fix runtime overlaid:

Cases Pre-fix 844e708 This head
Four confidentiality regressions Fail Pass
Three existing safe rejection controls Pass Pass
Existing Redis relay convergence Pass Pass

The installed pre-fix and fixed binaries both reject the two malformed configurations. Only the pre-fix binary includes the synthetic confidential values in its output.

Upgrade impact and limits

Invalid Redis settings now produce a generic diagnostic instead of parser details. Empty settings, address prefixing, connection failures, and successful relay setup keep their existing behavior.

No frontend, dependency, protocol, or architecture changes. Live Redis, GCS, and S3 services were not exercised; the Redis integration control uses miniredis. Existing frontend test failures were not changed or counted as passing.

@isac322 isac322 self-assigned this Nov 3, 2026
@isac322
isac322 requested a review from runbear-bot November 3, 2026 11:38

@runbear-bot runbear-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bobb's bot(Totoro) Review

Conclusion: ready-with-notes

파싱 실패 시 ParseURL의 원문 오류를 버리고 고정된 오류를 반환하므로 Redis 사용자명·비밀번호·쿼리값 등 설정값이 진단에 포함되지 않습니다. 호출 경로(cmd/bdrive/web.go)도 이 오류를 그대로 startup refusal로 전달합니다.

Notes

  • internal/webapp/collab_relay.go:50-52: 잘못된 scheme/database/timeout이 모두 같은 메시지로 합쳐져 안전한 진단 정보도 사라집니다. 설정값을 포함하지 않는 고정된 오류 분류나 안내 문구를 고려해 주세요.
  • internal/webapp/ycollab_cluster_test.go:352-365: 테스트가 “어떤 오류든 발생”만 확인하므로 의도한 parse-error 경로와 고정 메시지를 직접 고정하지는 않습니다. 현재 변경의 merge blocker는 아닙니다.

Verification

  • git diff --check: passed.
  • Focused Go test, go vet ./..., go build ./...: not run (reason: Go toolchain is not installed; go: command not found), each 0 / 0 / 0.
  • Independent OMX draft: completed; no blocker found. Live Redis/GitHub CI were not exercised.

@isac322

isac322 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Keeping the fixed diagnostic is intentional. URL and query parsers can echo configuration values, and no caller branches on the error text. Additional diagnostic categories would add branches without strengthening the confidentiality guarantee.

The tests assert both rejection and omission of configuration values. With the same final tests, four confidentiality cases fail on 844e708 and pass on 2d797f0; three safe-rejection controls and the existing Redis convergence test pass on both. The installed binaries show the same rejection with confidential values absent only after the fix. Exact diagnostic wording is not part of that contract, so I am keeping these behavioral assertions.

@isac322
isac322 requested a review from runbear-bot November 3, 2026 11:54

@runbear-bot runbear-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bobb's bot(Totoro) Review

Conclusion: ready-with-notes

파싱 오류에서 원본 진단을 전달하지 않아 설정값 노출 경로를 차단하며, 기존 호출자는 오류를 반환해 서버 시작을 중단합니다. 머지 차단 사항은 발견하지 못했습니다.

Verification

  • git diff --check 844e708...2d797f0: 통과.
  • 집중 Go 테스트 go test ./internal/webapp -run 'TestConnectCollabRedisParseErrorOmitsSecrets|TestCollabProcessesConvergeOverRedis': 미실행, 0 / 0 / 0 (Go 도구 없음). 실제 Redis 및 CLI 실행은 검증하지 못했습니다.
  • 작성자는 base 대비 기밀값 노출 회귀 테스트와 설치 바이너리 검증을 보고했습니다. 이는 작성자 보고이며 독립 실행 결과는 아닙니다.

@isac322
isac322 merged commit f9fd883 into main Nov 3, 2026
5 checks passed
@isac322
isac322 deleted the fix/redis-error-diagnostics branch November 3, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants