Skip to content

[codex] fix: reject credentials in advertised endpoint URLs#3516

Open
StiensWout wants to merge 1 commit into
pingdotgg:mainfrom
StiensWout:staging/reject-userinfo-advertised-endpoints
Open

[codex] fix: reject credentials in advertised endpoint URLs#3516
StiensWout wants to merge 1 commit into
pingdotgg:mainfrom
StiensWout:staging/reject-userinfo-advertised-endpoints

Conversation

@StiensWout

@StiensWout StiensWout commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject advertised endpoint URLs that contain userinfo credentials.
  • Keep downstream connection handling from accepting credential-bearing endpoint strings.

Why

URLs with embedded credentials should not be accepted as advertised endpoints because they can leak secrets through display, logging, or transport boundaries.

Impact

Credential-bearing advertised endpoints are rejected before they can be stored or used.

Validation

  • PATH="$HOME/.vite-plus/bin:$PATH" vp test packages/client-runtime/src/environment/endpoint.test.ts
  • PATH="$HOME/.vite-plus/bin:$PATH" vp check
  • PATH="$HOME/.vite-plus/bin:$PATH" vp run -r --concurrency-limit 1 typecheck

Note

Low Risk
Small input-validation hardening on endpoint URLs; only affects credential-bearing URLs that should not be advertised.

Overview
Advertised endpoint URLs with embedded userinfo are now rejected during normalization instead of being accepted and propagated.

normalizeHttpBaseUrl in advertisedEndpoint.ts throws "Endpoint URL must not include credentials." when url.username or url.password is non-empty, before path/query/hash normalization. That applies to HTTP/HTTPS and ws/wss inputs (after protocol coercion), so createAdvertisedEndpoint, deriveWsBaseUrl, and other callers that normalize through this helper fail early. Connection onboarding that normalizes httpBaseUrl surfaces the same error as invalid configuration.

Tests cover https://user:password@…, wss://user@…, and credential-bearing createAdvertisedEndpoint inputs.

Reviewed by Cursor Bugbot for commit 13861a1. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Reject credentials embedded in advertised endpoint URLs

Adds a credentials check to normalizeHttpBaseUrl in advertisedEndpoint.ts. If the URL contains a non-empty username or password, the function throws "Endpoint URL must not include credentials." before any normalization occurs. Behavioral Change: callers passing URLs with embedded credentials will now receive an error instead of silently proceeding.

Macroscope summarized 13861a1.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c64c4c90-f719-4e2c-9743-06142fde2054

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jun 23, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR adds security validation to reject URLs with embedded credentials. While the change is small and well-tested, security-related changes warrant human review to verify the validation is appropriately placed and handles all relevant code paths.

You can customize Macroscope's approvability policy. Learn more.

@StiensWout StiensWout force-pushed the staging/reject-userinfo-advertised-endpoints branch from 4ea013b to 2ffeb29 Compare June 23, 2026 05:50
Co-authored-by: Codex <codex@openai.com>
@StiensWout StiensWout force-pushed the staging/reject-userinfo-advertised-endpoints branch from 2ffeb29 to 13861a1 Compare June 23, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant