Repository navigation
Description
Summary
The DIFC proxy step (and the CLI proxy step) start the gh-aw-mcpg container by its mutable tag, although the compiler already resolves a digest pin for the same image and uses it for the MCP gateway. The proxy step receives GH_TOKEN (the GitHub MCP server token), so a moved tag would run different code with that token without any change to the compiled lock file.
Same class of defect as #51248 (tag-only gh-aw-firewall images), for the MCP gateway image used in proxy mode.
Observed (gh-aw v0.92.0)
Workflow with tools.github.min-integrity: approved and a custom pre-agent step that uses GH_TOKEN. The compiled lock file contains:
# manifest header
# - ghcr.io/github/gh-aw-mcpg:v0.4.31@sha256:dbec0f2ddef6adf83b7764019323096e3e5cc0f3886255f6320555b7fe2a7caf
- name: Start DIFC Proxy
env:
GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
...
DIFC_PROXY_POLICY: '{"allow-only":{"min-integrity":"approved","repos":"all"}}'
DIFC_PROXY_IMAGE: 'ghcr.io/github/gh-aw-mcpg:v0.4.31'
run: |
bash "${RUNNER_TEMP}/gh-aw/actions/start_difc_proxy.sh"Download container images and MCP_GATEWAY_DOCKER_COMMAND later in the same job use ghcr.io/github/gh-aw-mcpg:v0.4.31@sha256:dbec0f2d…. The proxy starts before that download step, so the tag is what actually runs.
Root cause
pkg/workflow/compiler_difc_proxy.go (identical on v0.92.0 and main):
func resolveProxyContainerImage(gatewayConfig *MCPGatewayRuntimeConfig) string {
version := gatewayConfig.Version
if version == "" {
version = string(constants.DefaultMCPGatewayVersion)
}
return gatewayConfig.Container + ":" + version
}It never applies the container pins. The gateway path in pkg/workflow/mcp_setup_gateway.go (buildMCPGatewayContainerCommand) builds the same container:version string and then calls resolveContainerImage(containerImage, workflowData), which yields the @sha256: reference. resolveProxyContainerImage is used by both buildStartDIFCProxyStepYAML (DIFC_PROXY_IMAGE) and buildStartCliProxyStepYAML (CLI_PROXY_IMAGE).
Also note the version fallback differs: the gateway uses effectiveMCPGatewayVersion(workflowData), the proxy uses constants.DefaultMCPGatewayVersion.
Proposed fix (agentic plan)
pkg/workflow/compiler_difc_proxy.go: changeresolveProxyContainerImageto takedata *WorkflowData, build the image exactly likebuildMCPGatewayContainerCommand(Container + ":" + Version, falling back toeffectiveMCPGatewayVersion(data)), and returnresolveContainerImage(image, data). Update both callers (buildStartDIFCProxyStepYAML,buildStartCliProxyStepYAML).- Tests (
pkg/workflow/compiler_difc_proxy_test.go):- With a container pin for the gateway image in the action cache,
DIFC_PROXY_IMAGEandCLI_PROXY_IMAGEequal the gateway's pinned reference (…:vX@sha256:…). - Without a pin, the value stays
container:version(unchanged behaviour). - The proxy image equals the image in
MCP_GATEWAY_DOCKER_COMMANDof the same lock file.
- With a container pin for the gateway image in the action cache,
- Recompile the repository's own lock files and check that no
DIFC_PROXY_IMAGE/CLI_PROXY_IMAGEvalue lacks@sha256:when the gateway image is pinned. - Optionally extend the lock-file audit that records
container_pin_not_foundfor firewall images (gh-aw-firewall/{agent,api-proxy,squid} emitted tag-only in v0.86.1 lock files (regression of #43307 / #38561) #51248) to flag any tag-only image passed to a step that also receives a token.
Activity