Skip to content

Prevent SSH servers in gateway images and document SSHHole applicability - #16421

Merged
lpcox merged 3 commits into
mainfrom
lpcox-patch-openssh-sshhole
Nov 12, 2026
Merged

lpcox merged 3 commits into
mainfrom
lpcox-patch-openssh-sshhole

Conversation

@lpcox

@lpcox lpcox commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Record that mcpg v0.5.8 is not affected by SSHHole (CVE-2026-123158): both shipped Linux architectures contain no OpenSSH packages or sshd files. No OpenSSH package installation or version bump is appropriate.
  • Fail the final runtime Dockerfile build if OpenSSH server packages (including PAM/server subpackages) or an sshd executable on PATH are introduced. Package inventory failures fail closed.
  • Add shell-level regression coverage for clean/client-only images, server variants, an unpackaged daemon, and package-query failures.

This is preventive hardening and an applicability assessment, not an OpenSSH package patch or an update to deployed images. Backend containers, derived images, and host SSH services require separate assessment. Firewall is being handled separately.

Evidence

Verified the upstream OpenSSH 10.6p2 release notes and Alpine advisory. Alpine 3.24's fixed server package is 10.3_p1-r2; the advisory excludes containers that do not run sshd.

Inspected every layer and the final populated /lib/apk/db/installed package database for ghcr.io/github/gh-aw-mcpg:v0.5.8 on 2026-11-12. Both architectures have 80 installed packages, no SSH packages, and no sshd filesystem entries. The entrypoint starts the gateway, not an SSH service. The Debian Bookworm development container uses glibc rather than the affected musl stack.

Image Digest
v0.5.8 index sha256:e237aabf51d4485474b9355649b811ca6c1db22359eeb1860832fc1fb5a7a347
linux/amd64 sha256:dab817040f9666831719bfc4517bff30f4eaae625b4ee7e8d492600b7e0b317e
linux/arm64 sha256:f8a03b4bd8ce3b6e0c5fb52386599a868bf4d1af4fa577bef8ff49d451299b74

Validation

  • go test . -run 'TestDockerfile' -count=1 passed.
  • make agent-finished passed: build, vet, golangci-lint (0 issues), Go tests, and 722 Rust guard tests.
  • git diff --check passed.

Gap: no local Docker daemon was available, so no new full image build or runtime authentication test was performed. Registry-layer inspection established the existing release's server absence; tests execute the actual Dockerfile check with mocked package inventories and executable lookup. No deployed image has been changed by this PR.

Document SSHHole non-applicability for both published v0.5.8 architectures and fail final-image builds if an OpenSSH server appears. Exercise the build check with shell-level regression tests.

Co-authored-by: Copilot App <[email protected]>
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 18:44
Comment thread dockerfile_test.go Resolved
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the preventive SSH-server image hardening and its supporting tests and documentation.

No open issues 🎉

What changed in this PR

This PR adds preventive hardening to keep SSH servers out of MCP Gateway runtime images and documents why the inspected v0.5.8 images are not affected by SSHHole. It does not patch OpenSSH or update deployed images.

Changes:

  • Reject final image builds containing OpenSSH server packages or an sshd executable on PATH, and fail closed on package-query errors.
  • Add shell-level regression coverage for clean, client-only, server-containing, and package-query-failure cases.
  • Document image inspection evidence, applicability limits, and separate assessment requirements for backend containers, derived images, and hosts.
File Description
SECURITY.md Records SSHHole applicability, image digests, and assessment limitations.
dockerfile_test.go Exercises the Dockerfile check with mocked package inventories and executable lookup.
Dockerfile Adds a final runtime-image check rejecting OpenSSH servers.

Review effort: Balanced (auto)

@lpcox

lpcox commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@github-actions

Copy link
Copy Markdown
Contributor

ð��� mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (normal AWF container isolation)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) no write tool exposed in catalog (23 read-only tools only) BLOCKED ⚠️
C CLI reads (github proxy CLI) data returned ALLOWED ✅
D CLI REST writes gh unauthenticated — no GH_TOKEN in job BLOCKED ⚠️
E CLI GraphQL mutations gh unauthenticated — no GH_TOKEN in job BLOCKED ⚠️

Overall: INCONCLUSIVE

No write leaked on any surface. Parts A and C fully confirm read access works. Parts B, D, and E could not independently confirm the gateway's own write-blocking layer:

  • Part B: The proxied github CLI exposes only 23 read-only tools (get_commit, get_file_contents, list_issues, list_pull_requests, issue_read, pull_request_read, search_*, etc.) — no write tool (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) appears in the catalog at all. This matches the gh-aw framework's GITHUB_READ_ONLY=1 backend behavior documented in the test plan; it cannot by itself distinguish gateway-level DIFC enforcement from upstream toolset configuration.
  • Part D/E: gh auth status reports no logged-in host and gh api / gh api graphql calls fail with a missing GH_TOKEN error — this job has no GitHub token at all, so the REST/GraphQL token-scope boundary was not exercised.

No reaction, star, issue, comment, branch, file, or PR was created. Full log: /tmp/gh-aw/agent/readonly-stress-43283394558.txt

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

Copilot AI commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the linting errors https://github.com/github/gh-aw-mcpg/actions/runs/43283394734/job/131410311685?pr=16421

Removed the stale imports. Focused Dockerfile tests and make lint pass; golangci-lint was unavailable locally. Fixed in f063e7e.

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.

4 participants