Proxy password leak lab: where a canary password showed up
A canary proxy password tested on loopback: where it showed up in curl -v, ps, shell history, pip, npm, git, Python errors and CI logs, and a fix for each.

Quick summary · TL;DR
- Run curl -v with the proxy in http_proxy and you get the password in plain text. The "Uses proxy env variable" line prints the whole URL, and every -v run prints the Proxy-Authorization header, which is just Base64 of user:password.
- ps shows curl -x http://user:pass@host to every local account on macOS. curl blanks --proxy-user and -U after a moment. pip --proxy and git -c http.proxy stay in the process list in full, so a -K config file is the safer habit.
- npm masks its own proxy setting and then prints HTTP_PROXY raw. npm 11.11.0 showed the env var in full under "environment-related config", and every npm run script saw npm_config_proxy with the password in it.
- git quietly saved the proxy login to .git-credentials. With credential.helper=store, one successful ls-remote through the proxy wrote http://canaryuser:CANARYpw7731@127.0.0.1%3a18941 to the file, even when the proxy came from http_proxy.
- Masks and grep miss the encoded copies. The same password showed up literal, percent-encoded and as Base64. In curl's hex trace the Base64 was split across dump lines, and nothing caught it.
If your proxy URL has a password in it, a proxy password leak usually starts with your own tools. In a canary test on 5 November 2026, a fake proxy password showed up in plain text in curl -v output, npm config list, an aiohttp 407 error, .git-credentials, ps and shell history. Base64 copies turned up in more places. Each one has a fix below.
Plenty of teams are rotating AI and cloud keys right now. Wiz’s Gheist report (25 October 2026) describes stolen GitHub tokens used to plant a workflow that printed repository secrets and the output of env into run logs, encoded in base32 so GitHub’s log masking would not catch them. The report doesn’t mention proxy credentials. But env prints HTTP_PROXY, and that variable often holds http://USERNAME:PASSWORD@HOST:PORT. The proxy login goes out with everything else, and it rarely makes the rotation list.
None of this depends on that campaign. It applies to any proxy, any provider and any login you can’t afford to have copied, and the test below shows where to look.
Where a proxy password leak shows up
Every row is a command that ran against a fake proxy on 127.0.0.1 with the canary login canaryuser / CANARYpw7731. The middle column uses three labels:
- “Plain”. The password itself was printed.
- “Base64”. The
Proxy-Authorizationheader was printed, and anyone can decode it back tocanaryuser:CANARYpw7731withbase64 -d. - “User only”. The username was printed, but not the password.
| Where | What it printed | Fix |
|---|---|---|
curl -v with -x http://user:pass@... | Base64 | Filter the log, or keep -v out of saved logs |
curl -v with the URL in http_proxy or ALL_PROXY | Plain, on the “Uses proxy env variable” line, plus Base64 | Same filter; it removes both |
curl --trace (hex) | Base64, split across dump lines | No text filter catches it; don’t keep hex traces |
ps while curl -x http://user:pass@... runs | Plain | --proxy-user (blanked) or -K config file |
ps while pip install --proxy ... or git -c http.proxy=... runs | Plain | Proxy from the environment instead of argv |
ps -E on your own process with HTTP_PROXY set | Plain | Loopback forwarder, see below |
| zsh and bash history | Plain, 4 of 4 lines; 3 with the leading-space option on | read -rs, then export |
pip config list, pip config get, pip config debug | Plain | Keep the proxy out of pip.conf and PIP_PROXY |
npm config list with HTTP_PROXY or http_proxy set | Plain | Unset before you paste the output anywhere |
npm config list with proxy in .npmrc | User only (canaryuser:***) | Already masked |
Any npm run script, proxy set in .npmrc | Plain, as npm_config_proxy | --ignore-scripts on installs; a named npm run still sees it |
pnpm config list, yarn config list | Plain | Same as pip: not in the config file |
| aiohttp 407 exception | Plain, in url='...' | Pass proxy_auth=aiohttp.BasicAuth(...), log str(err) not repr(err) |
requests with host:port:user:pass pasted as the proxy | Plain, in InvalidURL | Parse it into a URL first |
| Python traceback of a script with the URL in source | Plain, on the source line | Read it from the environment |
http.client debuglevel, urllib debug handler | Base64 | Leave debuglevel at 0 outside a terminal |
axios JSON.stringify(err.toJSON()) with proxy.auth | Plain | Log err.code and err.message |
git config --list, .gitconfig | Plain | Username-only proxy URL plus a helper |
git ls-remote through the proxy with credential.helper=store | Plain, written to .git-credentials | Same; don’t use store on that box |
GIT_TRACE_CURL=1 | User only | Already redacted; GIT_TRACE_REDACT=0 shows Base64 |
env in a job, bash -x, make with $(VAR) | Plain | { set +x; } 2>/dev/null around the step, $$VAR in make |
Clean results matter too. None of these printed the password:
- plain error messages from requests 2.34.2, urllib3 2.8.0, httpx 0.28.1 and undici, for a dead proxy and for a 407
- Node’s built-in fetch, for a dead proxy
- pip at
-vvv, its--logfile anduv pip install -vv npm --verbose, npm’s debug log andyarn --verbose
How the test ran
A small Python proxy listened on 127.0.0.1, demanded Basic auth, and answered every request itself, so nothing left the machine. Every target was an IP literal on 127.0.0.1, so there wasn’t even a DNS lookup. A second copy always answered 407, and a third port had nothing on it for the “proxy down” case. Every command ran under env -i with a temporary HOME, XDG_CONFIG_HOME and npm cache, so no real config, .npmrc, .netrc or history file was read or changed. Git ran with GIT_CONFIG_NOSYSTEM=1 and an empty credential helper, so the system keychain was never touched. A script then searched each output for the password, the Base64 header and the username.
The machine was macOS 26.6.2 with curl 8.7.1 (Apple’s build), git 2.50.1, Python 3.12.13 with pip 26.3, Node 24.14.1 with npm 11.11.0, pnpm 12.16.1, yarn 1.22.22, axios 1.21.0, undici 8.12.4, https-proxy-agent 9.1.0, aiohttp 3.14.5 and uv 0.12.0, plus zsh 5.9 and bash 3.2.57. The first pass produced 156 scripted results and 4 throwaway shell histories on 5 November 2026 (UTC). A second, independent re-run the same day used a new proxy script and fresh temp homes, and repeated every leak in the table in 107 results, the 4 histories included.
What wasn’t run here: Linux, Windows, a real CI runner, and Docker. Docker isn’t installed on this Mac and wasn’t installed for the test, so everything about images below is read from Docker’s documentation, not measured. Tool versions change this behaviour, so rerun the check on yours.
curl verbose and trace output
This is the proxy password leak people paste into tickets without noticing. With the proxy in -x, curl -v keeps the URL out of the log but prints the header:
* Proxy auth using Basic with user 'canaryuser'
> GET http://127.0.0.1:18949/ HTTP/1.1
> Host: 127.0.0.1:18949
> Proxy-Authorization: Basic Y2FuYXJ5dXNlcjpDQU5BUllwdzc3MzE=
Moving the password to --proxy-user or a .curlrc doesn’t change that block. The header is what curl sends, so verbose mode shows it, and --trace-ascii prints the same line.
Put the URL in http_proxy instead and it gets worse, because curl announces where it found the proxy:
* Uses proxy env variable http_proxy == 'http://canaryuser:CANARYpw7731@127.0.0.1:18941'
ALL_PROXY printed the same line. Uppercase HTTP_PROXY was ignored for an http:// URL, because curl only reads the lowercase http_proxy, so that request went direct instead.
curl’s own manual covers this under --trace: verbose output “might contain sensitive data, including user names, credentials”. If a CI job needs -v, pipe it through a filter before it reaches the log. This one removed the password and the Base64 from both the -v and the --trace-ascii outputs in the test, leaving only the username line:
curl -v ... 2>&1 | sed -E 's/(Proxy-Authorization: Basic ).*/\1<redacted>/; s#//[^/@ ]+:[^/@ ]+@#//<redacted>@#'
It does nothing for hex --trace. And --libcurl out.c writes the password into the generated C file, which is easy to forget once that file lands in a repo. More curl proxy flags are in the curl proxy guide.
Process lists and shell history
While curl ran, ps -ww -o args= showed this for the inline form:
curl -sS -x http://canaryuser:CANARYpw7731@127.0.0.1:18941 http://127.0.0.1:18949/slow
With --proxy-user or -U, curl overwrote the argument in place, and ps showed a row of spaces where the login had been. The curl manual is honest about the limit: the value is “visible for a moment before cleared”, so it says to read it from a file. A -K config file showed nothing in ps at all. pip and git didn’t blank anything, so pip install --proxy http://user:pass@... and git -c http.proxy=http://user:pass@... both sat in ps in full.
Who can read that? On macOS /bin/ps is setuid root, and as an ordinary user it printed the arguments of root daemons such as /usr/sbin/systemstats --daemon. So command lines are readable by every local account. ps -E printed HTTP_PROXY for processes owned by the same user, but for root’s processes it printed no environment. On Linux this wasn’t run. The proc(5) pages say /proc/<pid>/cmdline holds the full command line, and reading /proc/<pid>/environ is governed by a ptrace access check, which in practice means the same user or root.
Shell history is the slower proxy password leak, because the file sits there for years. In throwaway zsh and bash sessions with HISTFILE pointed at a temp file, export HTTP_PROXY=..., a curl -x line and a curl --proxy-user line all landed in the file. A line typed with a leading space was saved too, unless setopt HIST_IGNORE_SPACE (zsh) or HISTCONTROL=ignorespace (bash) was set first. One catch: zsh started with -f saved no history at all, which is easy to mistake for a clean result.
What stayed out in all four shells was the password typed at a read -rs prompt:
read -rs PROXY_PASS
export HTTPS_PROXY="http://USERNAME:${PROXY_PASS}@HOST:PORT"
History then holds read -rs PROXY_PASS and a line with ${PROXY_PASS} in it, not the value.
pip and npm config
pip masks credentials in an index URL. With a login in --index-url, it printed Looking in indexes: http://canaryuser:****@127.0.0.1:18942/simple/. The proxy setting gets no such care. After pip config set global.proxy, the password sat in ~/.config/pip/pip.conf and came back in plain text from pip config list, pip config get and pip config debug. PIP_PROXY in the environment showed up the same way, as :env:.proxy='http://canaryuser:CANARYpw7731@127.0.0.1:18941'. Plain HTTPS_PROXY and HTTP_PROXY were used by pip but not listed by pip config list.
npm does mask its own setting. With proxy in .npmrc, npm config list printed proxy = "http://canaryuser:***@127.0.0.1:18941" and npm config get proxy refused with “The proxy option is protected”. npm install --verbose and the debug log in ~/.npm/_logs didn’t print the login at all, even though the request went through the proxy.
The environment section is the gap. With HTTP_PROXY and HTTPS_PROXY set, npm 11.11.0 printed this:
; environment-related config
; HTTP_PROXY = "http://canaryuser:CANARYpw7731@127.0.0.1:18941"
; HTTPS_PROXY = "http://canaryuser:CANARYpw7731@127.0.0.1:18941"
Lowercase http_proxy came out the same way.
That matches npm/cli issue #9773, opened 16 July 2026. It was still open when checked on 5 November 2026, with a fix commit referencing it dated 4 November, so check your version before you paste npm config list into a bug report.
Lifecycle scripts are the other npm surprise. With the proxy in .npmrc, an npm run script that printed its environment showed npm_config_proxy=http://canaryuser:CANARYpw7731@127.0.0.1:18941. Every install script of every dependency runs with that variable. Writing proxy=${PROXY_URL} in .npmrc keeps the file clean, and npm expanded it and masked it in config list, but the script still saw the expanded value.
pnpm 12.16.1 and yarn 1.22.22 masked nothing. pnpm config list and yarn config list printed the full URL, and the files they wrote (~/.config/pnpm/config.yaml and ~/.yarnrc) held it in plain text.
Python tracebacks and debug logging
Default error paths were cleaner than expected. A dead proxy in requests raised ProxyError: HTTPConnectionPool(host='127.0.0.1', port=18942)... and a refused HTTPS tunnel raised Tunnel connection failed: 407 Proxy Authentication Required, with no login in either. logging.exception() and urllib3’s DEBUG logging stayed clean too, as long as the URL was read from the environment. With the URL written into the script, logging.exception() printed it on the source line, as below.
Four places leaked:
- aiohttp. A 407 ended with
ClientHttpProxyError: 407, message='Proxy Authentication Required', url='http://canaryuser:CANARYpw7731@127.0.0.1:18943'. Withproxy='http://127.0.0.1:18943'andproxy_auth=aiohttp.BasicAuth(...), the same error printedurl='http://127.0.0.1:18943'. That holds forstr(err), a plain traceback andlogging.exception().repr(err)was different: it includes the CONNECT request’s headers, and the Base64Proxy-Authorizationwas in there. - A string requests can’t parse. Paste a
host:port:user:passstring as the proxy and requests raisesInvalidURL: Failed to parse: '127.0.0.1:18941:canaryuser:CANARYpw7731' is not a valid host or port. Inside a URL, a password with an unencoded/printed half of itself:'canaryuser:CANARY' is not a valid host or port. Splitting the string and percent-encoding the parts, as in the proxy string formats guide, fixed both. - Tracebacks that show code or locals. A script with the URL written in its source printed that line in a plain traceback.
traceback.TracebackException(..., capture_locals=True), which some error reporters use, printed the password on 9 lines of a 160-line trace, plus the Base64 header. - Wire-level debug.
http.client.HTTPConnection.debuglevel = 1and urllib’s debug handler printed theProxy-Authorizationheader. httpx was mixed:repr(httpx.URL(...))showed[secure], butstr()of the same URL printed the password.
The Python requests proxy guide has the encoding step in full.
Node: axios and agent objects
console.log(agent) on an undici ProxyAgent or an HttpsProxyAgent printed the parsed URL with password: 'CANARYpw7731'. In axios with proxy.auth, console.log(err) showed the Base64 header, and JSON.stringify(err.toJSON()) included "auth":{"username":"canaryuser","password":"CANARYpw7731"}. Anything that serialises errors to JSON keeps that. Logging err.code and err.message printed ECONNREFUSED connect ECONNREFUSED 127.0.0.1:18942 and nothing else.
git config and credential helpers
git config --global http.proxy http://user:pass@... writes the URL into ~/.gitconfig, and git config --list prints it back. Git’s traces are careful. GIT_TRACE_CURL=1 printed Proxy-Authorization: Basic <redacted>, and only GIT_TRACE_REDACT=0 showed the Base64, which matches git’s documentation.
Then came the credential helper, which was the real surprise. After a successful git ls-remote through the proxy with credential.helper=store, .git-credentials held a new line:
http://canaryuser:CANARYpw7731@127.0.0.1%3a18941
The same happened when the proxy came from http_proxy instead of git config. Git saved the proxy login like any other credential it had used. Keychain helpers weren’t tried, because that would write into a real keychain.
Git’s manual describes the fix: a proxy URL with a user name but no password makes git ask for the password the way it asks for any other credential. In the test, http.proxy=http://canaryuser@127.0.0.1:18941 with a helper that printed password=$PP from the environment worked, and ps showed no password. Just don’t pair it with store.
CI logs and environment dumps
These were run locally, not on a real runner. env | grep -i proxy printed both variables in full, and the Gheist payload ran plain env too, piped through base32. bash -x expanded "$PROXY_URL" into the trace even though the script never spelled out the value. Even the “safe” pattern leaked: printf 'proxy-user = "%s"' "$PU" | curl -K - kept the password out of ps, but bash -x printed the printf line with the value in it. Turning tracing off for the step fixed it:
{ set +x; } 2>/dev/null
umask 077
printf 'proxy-user = "%s"\n' "$PROXY_LOGIN" > "$HOME/proxy.cfg"
set -x
curl -sS -K "$HOME/proxy.cfg" -x http://HOST:PORT https://example.com/
rm -f "$HOME/proxy.cfg"
In a Makefile, $(PROXY_URL) was expanded in the echoed command and $$PROXY_URL wasn’t.
GitHub Actions masking wasn’t tested, so this part comes from GitHub’s secure use reference (no date on the page, read 5 November 2026). What it says about masking:
- Redaction matches the exact secret value, and the page says it can’t be guaranteed.
- A Base64 or URL-encoded copy has to be registered as its own secret.
::add-mask::covers values that aren’t secrets.- Structured data such as JSON can break redaction.
- After an unredacted leak, the advice is to delete the log and rotate.
For a proxy login that means at least three strings. The canary CANARY/pw#7731 became:
literal CANARY/pw#7731
percent CANARY%2Fpw%237731
basic header Y2FuYXJ5dXNlcjpDQU5BUlkvcHcjNzczMQ==
base32 INAU4QKSLEXXA5ZDG43TGMI=
Mask the full proxy URL and the Base64 header still gets through. Mask the password and the percent-encoded form still gets through. The base32 line is the trick from the Wiz report.
Docker history and build args
Docker isn’t installed on this Mac, so this section is read from Docker’s documentation and was not run. Nothing in the table above comes from Docker.
- The Dockerfile reference says the predefined proxy args (
HTTP_PROXY,HTTPS_PROXYand friends) are excluded fromdocker historyby default, and that a Dockerfile which declaresARG HTTP_PROXYgets the value “preserved in thedocker history”. - The build variables page says build args and environment variables are inappropriate for passing secrets and may persist in image metadata, provenance attestations and image history. It recommends secret mounts (
RUN --mount=type=secret). - The proxy configuration page warns against
ENVfor proxy settings because it embeds the configuration into the image. It also says environment variables are stored as plain text in the container’s configuration and can be inspected through the remote API or committed withdocker commit.
So pass the proxy with --build-arg or the proxies block in ~/.docker/config.json, and never declare it with ARG or ENV.
After a proxy password leak
If any of the above put your password in a log, a ticket, an image or a repo, treat it like a leaked API key:
- Change the password with your provider before anything else. Deleting the log doesn’t help if someone already copied it.
- Search your own logs and artifacts for all three spellings. This version keeps the password out of
psand history, becauseprintfis a shell builtin and the patterns go through a file descriptor:
read -rs PROXY_PASS
B64=$(printf '%s:%s' "USERNAME" "$PROXY_PASS" | base64 | tr -d '\n')
ENC=$(PROXY_PASS="$PROXY_PASS" python3 -c 'import os,urllib.parse as u;print(u.quote(os.environ["PROXY_PASS"],safe=""))')
grep -rlFf <(printf '%s\n' "$PROXY_PASS" "$ENC" "$B64") ./logs
In the test it found the plain, percent-encoded and Base64 files and skipped the clean one. It won’t find a hex trace or the base32 form.
- Delete the logs it finds, as GitHub’s guidance says for CI logs, and check
.git-credentials,pip.conf,.npmrc,~/.config/pnpm/config.yaml,.yarnrcand.gitconfigon every machine that used the login. With the store helper,printf 'url=http://USERNAME@HOST:PORT\n\n' | git credential rejectremoved the saved proxy line from.git-credentialsin the test. - Then fix the place it came from, using the table at the top.
Keep the password out of clients
Most fixes above move the password to somewhere less visible. The one that removed it from every client output was a small forwarder on 127.0.0.1 that added the Proxy-Authorization header itself and relayed to the canary proxy. Clients only knew http://127.0.0.1:18944. curl -v, pip -vvv, npm’s silly log, GIT_TRACE_REDACT=0 git traces, requests with http.client debug, env and ps all came back with no password and no Base64, and git stored nothing in .git-credentials.
It has a cost. Any process on that machine can use the forwarder without a login, so it belongs on a single-user box or inside a container network, never on a port others can reach. And the password still has to live somewhere. In the test it was handed to the forwarder through its environment, which the same user can read.
Every proxymint tier authenticates with a username and password, including static ISP proxies and rotating residential proxies, so this checklist applies to those logins the same way it does to any other. If your setup only needs the proxy in one or two tools, a -K file for curl, a username-only URL for git and read -rs in the shell cover most of it. If the login goes into CI or shared machines, put a forwarder in front so the password never reaches the client logs in the first place.
Frequently asked questions
Not in plain text when the proxy is set with -x or --proxy-user, but the Proxy-Authorization header it prints is a Base64 string that decodes straight back to the username and password. With the proxy in http_proxy or ALL_PROXY, curl 8.7.1 also printed the full URL, password included, on the "Uses proxy env variable" line.
Command-line arguments, yes. On macOS ps is setuid root, and it showed root daemons' arguments to an ordinary user. That makes curl -x http://user:pass@host, pip --proxy and git -c http.proxy visible to every local account. The environment shown by ps -E was readable only for processes owned by the same user.
Only for its own proxy and https-proxy settings, which npm config list shows as canaryuser:*** and npm config get refuses to print. Environment variables are another matter. With HTTP_PROXY or http_proxy set, npm 11.11.0 printed the full value in the environment section, and npm run scripts receive npm_config_proxy unmasked.
No. Base64 is an encoding, not encryption, and base64 -d turns Y2FuYXJ5dXNlcjpDQU5BUllwdzc3MzE= back into canaryuser:CANARYpw7731 instantly. Treat any log line with that header as a leaked password.
Docker's documentation says the predefined proxy build args are left out of docker history by default, but a Dockerfile that declares ARG HTTP_PROXY keeps the value in the history. ENV writes it into the image. This was read from Docker's docs, not run, because Docker is not installed on the test machine.
Only the exact value registered as a secret, according to GitHub's secure use reference. A Base64 or URL-encoded copy has to be registered separately, and a proxy URL stored as one secret does not mask the password inside a Proxy-Authorization header. This was not tested on a runner.
Change the password with your provider first, because deleting a log does not undo a copy. Then search your logs and config files for the literal, percent-encoded and Base64 forms, delete the logs you find, and fix the tool that printed it.
Researched and drafted with AI tools, then checked against our publishing rules before it went live: 8 outside links, 5 links to other proxymint pages, no prices and a fact-check pass against our product records. How we write.
