# Protocol: Proxy auth header leakage

Slug: `proxy-auth-header-leak-3day`  
Frozen at: `2026-11-24T13:19:03Z`  
Question: Do Proxy-Authorization or username tokens appear in upstream Host/SNI or redirect URLs on CONNECT / SOCKS5h?

This study measures credential placement and leakage surfaces on authenticated residential HTTP CONNECT and SOCKS5h. It is not a stickiness study, not a kill-switch study, and not a VPN tunnel measurement.

## Schedule

Collection starts `2026-11-24`. The target list is frozen on that day, and the first diary slot runs the same day.

| Slot id | Window (UTC) |
| --- | --- |
| `20261124-immediate` | `2026-11-24T00:00:00Z`–`2026-11-24T17:50:00Z` |
| `20261124T1800Z` | `2026-11-24T17:50:00Z`–`2026-11-24T18:45:00Z` |
| `20261125T0600Z` | `2026-11-25T05:50:00Z`–`2026-11-25T06:45:00Z` |
| `20261125T1800Z` | `2026-11-25T17:50:00Z`–`2026-11-25T18:45:00Z` |
| `20261126T0600Z` | `2026-11-26T05:50:00Z`–`2026-11-26T06:45:00Z` |
| `20261126T1800Z` | `2026-11-26T17:50:00Z`–`2026-11-26T18:30:00Z` |

Stop after `2026-11-26T18:30:00Z`. Do not open another slot. The research article and the site page are written after that stop, on this branch. The Day 0 screen chooses the frozen list; it is not pooled into diary rates.

## Vantage and conditions

USA Cursor cloud agent. Three conditions, same frozen URLs, same client:

| Condition | Path |
| --- | --- |
| `direct` | No proxy. Process proxy environment variables are removed. |
| `residential-http` | ProxySeller residential HTTP proxy (`CONNECT` for HTTPS) from `PROXYSELLER_HOST`, `PROXYSELLER_HTTP_PORT`, `PROXYSELLER_USER`, `PROXYSELLER_PASS`. |
| `residential-socks5h` | Same product, SOCKS5 with remote DNS (`--socks5-hostname` / SOCKS hostname dest) on `PROXYSELLER_SOCKS_PORT`. |

CometVPN is `NOT_RUN`. This study does not open a VPN tunnel. If a proxy condition cannot start because a required variable is missing, that condition is `not_run` for the slot and the other conditions still run.

Session mode: **reuse injected credentials** for the whole study. Continuity is not the question, so no session-id suffix rotation and no stickiness claim.

## Client

System curl (Ubuntu). Authentication uses a private curl `--config` file under gitignored `private/` (`proxy-user = …`). Values are never placed on argv, never printed, never committed.

User-Agent: `FreePolicyToolsResearch/1.0 (+https://freepolicytools.com/; proxy-auth-header-leak-3day)`.

Requests are HTTPS only. Redirect responses are inspected (`Location`) and **not** followed for primary rows. Connect timeout 10s, total timeout 20s.

In-process tunnel inspect (one per proxy condition per slot) opens CONNECT or SOCKS5h to `example.com:443`, then performs a TLS handshake with `server_hostname=example.com`. That records whether the CONNECT authority / SOCKS destination hostname / SNI equal the destination and whether username, password, or Basic tokens appear in those strings.

## Leak surfaces

A row records boolean leak flags only (no secret material):

| Surface | What is checked |
| --- | --- |
| CONNECT Host / authority | Equals `target:443`; no username/password/Basic token |
| Verbose origin `Host` | Equals target hostname; no credential tokens |
| Origin header echo | `Host` equals target; `Proxy-Authorization` absent; `Authorization` absent |
| Redirect `Location` / curl `redirect_url` | No username/password/Basic token; no userinfo |
| Effective URL | No userinfo |
| SNI / SOCKS dest (tunnel inspect) | Equals `example.com`; no credential tokens |

Expected placement (not a leak): on `residential-http`, `Proxy-Authorization` appears on the CONNECT request to the proxy. It must not appear in origin echoes. On `residential-socks5h` and `direct`, CONNECT `Proxy-Authorization` is not expected.

## Freeze rule

Candidate order is `PRIORITY` in `scripts/collect_slot.py`. Membership is not reordered after outcomes.

1. Probe candidates in order over **residential-http only** (lean).
2. Accept a candidate when transport succeeds and the role check passes (`header_echo` → JSON headers + HTTP 200; `redirect` → 3xx with Location; `clean_host` → HTTP 200).
3. Freeze the first **4** successes (`FROZEN_CAP=4`), preferring role diversity (echo, redirect, clean host) when the clean-host role would otherwise be missing.
4. One Cloudflare path-check and one CONNECT tunnel inspect complete the screen.

Applied rule: **`residential-http-role-success`**.

### Frozen hosts

| Order | URL | Role | Screen |
| --- | --- | --- | --- |
| 1 | `https://httpbingo.org/redirect-to?url=https://example.com/&status_code=302` | `redirect` | 302 |
| 2 | `https://postman-echo.com/headers` | `header_echo` | 200 |
| 3 | `https://postman-echo.com/redirect-to?url=https://example.com/` | `redirect` | 302 |
| 4 | `https://example.com/` | `clean_host` | 200 |

`https://httpbingo.org/headers` was first in priority but failed the screen (`http_code` 0). It is not frozen. Reserve `httpbin.org` candidates were not needed.

### Path check

Every slot fetches `https://www.cloudflare.com/cdn-cgi/trace` once per condition. Raw IP is replaced by a salted hash. Only `loc`, `colo`, `http`, `tls`, `warp`, and `ip_hash` are kept.

## Diary procedure

For each frozen host, each slot runs `direct`, `residential-http`, and `residential-socks5h`. Each condition also runs the path check. Each proxy condition runs one tunnel inspect to `example.com`.

Primary article table: counts of clean CONNECT Host, clean echo Host, clean redirect Location, absent origin `Proxy-Authorization`, and clean SNI/dest inspect — by condition and slot.

## Redaction and secrets

Committed files must not contain proxy host, username, password, Proxy-Authorization material, Basic tokens, or raw IP addresses. The collector scans evidence and `hosts.frozen.json` before they leave disk. `private/` is gitignored. Verbose logs are temporary and deleted with the process scratch directory.

Runtime secret names (values never published): `PROXYSELLER_HOST`, `PROXYSELLER_HTTP_PORT`, `PROXYSELLER_SOCKS_PORT`, `PROXYSELLER_USER`, `PROXYSELLER_PASS`.

## Limits known at freeze

- One HTTP client (curl) plus a small in-process TLS inspect. No browser.
- One residential proxy product. Exit country may rotate across slots; one path-check per condition does not prove every request shared an exit.
- Header-echo third parties may add `Via` / `X-Forwarded-*`. Those are recorded as header **names** only when present; values are not published.
- SNI is observed as the `server_hostname` passed into the local TLS stack after CONNECT/SOCKS. A transparent MITM that rewrote SNI on the proxy–origin leg is outside this vantage.
- Cap of four frozen URLs is intentional lean budgeting for ProxySeller.
- No VPN condition (`CometVPN = NOT_RUN`).

## Prior work, as a snapshot only

The proxy-encryption study separated proxy-auth bytes from origin TLS on a local fixture. This diary asks whether auth material appears on live CONNECT/SOCKS5h upstream Host/SNI/redirect surfaces through ProxySeller residential.

Affiliate links for `/proxyseller/` and `/cometvpn/`, and the disclosure, belong in the article after the last slot. They are not part of the frozen method.
