Repository navigation
feat(control): pipelineMustNotSendSecretsToUntrustedHosts (ISSUE-311) - #530
Open
thomasboni wants to merge 4 commits into
Open
thomasboni wants to merge 4 commits into
thomasboni wants to merge 4 commits into
Conversation
thomasboni
force-pushed
the
feat/secret-egress-control
branch
from
October 8, 2026 00:37
7bd14e3 to
d2a6910
Compare
thomasboni
force-pushed
the
feat/secret-egress-control
branch
from
October 8, 2026 00:59
d2a6910 to
277015b
Compare
thomasboni
force-pushed
the
feat/secret-egress-control
branch
from
October 8, 2026 01:27
277015b to
0bbbff8
Compare
thomasboni
force-pushed
the
feat/secret-egress-control
branch
from
October 8, 2026 01:53
0bbbff8 to
2601f7c
Compare
…311) A script line that uses a network client to send a secret to a host the policy does not trust is a critical finding, one per job and host. GitHub reads the secrets context and env bindings; GitLab reads masked settings variables and the predefined tokens and abstains without the variables lane. Unresolvable destinations stay silent by design. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The engine config carries the provider's VCS hosts (GitHub's fixed set, the GitLab instance and registry hosts from the configured URL). On GitLab the control joins the settings-variables lane: it is collected with it, degrades with it and reports not_evaluable without it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…fault Terminal stats, legacy JSON (secretEgressResult) and the MR comment carry the new control; the shipped default enables it on both providers with the VCS hosts trusted; config init offers it as a composition. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…311) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
thomasboni
force-pushed
the
feat/secret-egress-control
branch
from
October 8, 2026 02:21
2601f7c to
6d02f6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In the GhostAction campaign (GitGuardian, September 2025, and its 2026 return), attackers pushed a workflow named "Github Actions Security" to hundreds of repositories. Its single
curlstep POSTed${{ secrets.* }}values, with names harvested from the repository's legitimate workflows, tohttp://193.32.204.199. Over three thousand secrets left that way. Run against a reproduction of that workflow, Plumber today raises only ISSUE-801 (missingpermissions). Nothing names the exfiltration line.This PR adds
pipelineMustNotSendSecretsToUntrustedHosts(ISSUE-311, critical) on GitHub and GitLab so that shape is caught before it runs.What fires
One shell command of a script line fires when it has all three parts:
curl,wget,nc/ncat/netcat,Invoke-WebRequest/Invoke-RestMethod/iwr/irm, httpiehttp/https, with or without.exe, bare, by path (/usr/bin/curl), escaped (\curl) or quoted at command start; andgit, only when the secret sits in the remote URL's userinfo or in anhttp.extraheaderconfig value;${{ secrets.NAME }}, or$NAME/${NAME}/$env:NAME/%NAME%/${{ env.NAME }}where NAME is bound tosecrets.*at workflow, job or step level; on GitLab a masked project CI/CD variable, orCI_JOB_TOKENand the other predefined tokens;http(s)://host[:port], a bracketed IPv6 literal, a bare IPv4, or a schemeless host (the client's first positional argument past flags, the value of--url/-Uri, or a dotted host carrying a path or port). A host that is only a side argument (a proxy-x, a--resolvemap, a header value,-o out.txt) is not a destination. A secret in the URL userinfo counts, and the destination is the host after the last@.Lines are read one command at a time:
&&,||,;and&cut the association, a pipe carries a secret forward, a$(...)or backtick substitution is its own command. Lines starting with#and trailing unquoted comments are ignored; trailing-backslash continuations are joined first. One finding per job and destination, naming the secrets.Configuration
A numeric glob such as
10.*matches IP literals only, never a hostname like10.attacker.example. A glob without a port does not cover the same host with a port: addhost:*. IPv6 entries may be written with or without brackets.What stays silent, and why
"$WEBHOOK_URL"): not judged, never a fake verdict.$CI_API_V4_URL, the literal instance host,api.github.com, the GHES instance.localhost,127.0.0.0/8,::1) and a single-label service alias (http://docker:2375,postgres): the secret stays on the runner. Built in, not configurable.curl https://get.example/x | sh && npm publish --token $SECRET): different commands.$(curl ...)fetches config: different commands.--resolve, or header value naming a host the client does not connect to.not_evaluable, not a pass.Evidence
golangci-lintand the deadcode check are clean. 117 fixtures underpolicies/testdata/ISSUE-311/(66 GitHub, 51 GitLab) cover each trigger part, each silence and each review finding; goldens, fingerprint pins and the message-style lint cover the new code.github_actions_security/send-secretsnamingVPS_HOST,VPS_SSH_KEYandVPS_USERto193.32.204.199. ISSUE-801 still fires. A benign ssh deploy workflow in the same repo stays silent.gitlab.com/thomasboni/test2branchplumber/e2e-secret-egress(ten cases): both report the same three findings (PASSWORDto193.32.204.199,CI_JOB_TOKENandPASSWORDtocollector.evil.example) and all seven clean cases (instance API, literal instance host, unmasked variable, no client, variable destination, localhost, service alias) are silent. Pipeline on the final commit (image built from 6d02f6c): https://gitlab.com/thomasboni/test2/-/pipelines/2924756077, job 17018189858. The standalone runs were repeated with the final binary after every review round.Follow-ups
docs/GITHUB_ISSUES.md: a secret copied to a file or shell variable and used by a later command, a destination in a variable,--connect-to,scp/rsync, and the best-effort command split.🤖 Generated with Claude Code
https://claude.ai/code/session_01Vcwjp52YnStKHvPcRmVQrR