Skip to content

feat(pac-proxy-agent): sanitize credentials in PAC proxy result logging - #421

Merged
TooTallNate merged 2 commits into
mainfrom
fix/sanitize-pac-credentials
May 3, 2026
Merged

feat(pac-proxy-agent): sanitize credentials in PAC proxy result logging#421
TooTallNate merged 2 commits into
mainfrom
fix/sanitize-pac-credentials

Conversation

@clutz-bot

@clutz-bot clutz-bot Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a sanitizeProxyResultCredentials() utility function that strips embedded credentials (userinfo) from PAC proxy result strings before they are logged via debug() or included in error messages.

Problem

PAC results can contain embedded authentication like PROXY user:pass@host:8080. When these are logged in debug output or error messages, credentials are exposed.

Solution

  • Added sanitizeProxyResultCredentials() that replaces userinfo with <credentials> (e.g. PROXY user:pass@host:8080PROXY <credentials>@host:8080)
  • Applied it to all debug() calls and the error message in connect() that include PAC results
  • Exported the function for consumers
  • Added comprehensive tests

This matches the approach used in VS Code's vscode-proxy-agent.

clutz-bot Bot and others added 2 commits May 3, 2026 20:13
…credentials from log output

Add a utility function that sanitizes PAC proxy result strings by replacing
embedded credentials (userinfo) with '<credentials>' for safe logging.

This prevents credentials from leaking into debug output and error messages
when PAC results contain embedded auth like 'PROXY user:pass@host:8080'.

The function is also exported for consumers to use directly.
@TooTallNate
TooTallNate merged commit ce0243e into main May 3, 2026
11 checks passed
@TooTallNate
TooTallNate deleted the fix/sanitize-pac-credentials branch May 3, 2026 21:26
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.

1 participant