Skip to content

fix(security): remove readiness check from MemPalace MCP server startup#28340

Merged
pelikhan merged 5 commits intomainfrom
copilot/fix-secret-exfiltration-issue
Apr 24, 2026
Merged

fix(security): remove readiness check from MemPalace MCP server startup#28340
pelikhan merged 5 commits intomainfrom
copilot/fix-secret-exfiltration-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

Runner-Guard RGS-012 flags any outbound HTTP request co-located with secrets access as a structural exfiltration risk — even a localhost curl. The shared/mcp/mempalace.md startup step used curl -sf http://127.0.0.1:8765/mcp to wait for the MemPalace MCP server to become ready.

Change

Remove the readiness check entirely. The server is launched in the background and the step exits immediately after logging the PID — no curl, no Python socket probe, no wait loop.

# Before — triggers RGS-012
if curl -sf http://127.0.0.1:8765/mcp >/dev/null 2>&1; then

# After — check removed entirely
python -m mempalace.mcp_server ... > /tmp/gh-aw/mcp-logs/mempalace/server.log 2>&1 &
echo "MemPalace MCP server started (PID $!)"

This eliminates the flagged exfiltration surface without introducing any alternative probe mechanism.

All lock files regenerated via make recompile.

@github-actions

This comment has been minimized.

…n mempalace MCP server startup

Resolves RGS-012: Secret Exfiltration via Outbound HTTP Request in daily-fact

The curl -sf http://127.0.0.1:8765/mcp health check was flagged by runner-guard
because the structural pattern (outbound HTTP + secrets access) is identical to
credential exfiltration attacks.

Replace with a Python TCP socket check that:
- Makes no HTTP requests
- Is hardcoded to 127.0.0.1:8765 (no env var injection possible)
- Cannot be repurposed to send data to external domains
- Still validates that the MCP server port is accepting connections

Regenerate daily-fact.lock.yml from the updated mempalace.md import.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b6c02014-7697-4aa7-ae9a-6d32188da0fb

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — thanks for picking up the RGS-012 secret exfiltration fix in the daily-fact workflow! Replacing the outbound curl health check with a Python TCP socket check is exactly the right approach for this kind of security finding.

A few things to address before this is ready for review:

  • No changes committed yet — the diff is currently empty. The PR body reads as a TODO list rather than a summary of completed work. Once the fix is implemented, please update the description to explain what was changed and why.
  • Add tests — if there's a way to validate the new TCP socket check (e.g., a unit test or integration test covering the health-check path), that would strengthen the PR.
  • Run the required checks — per CONTRIBUTING.md, all PRs must pass make build, make test, make lint, make recompile, make fmt, and make lint-errors.

Once you've implemented the changes, you can use the prompt below to complete the work:

In the file shared/mcp/mempalace.md, replace the curl HTTP health check with a Python TCP socket check to eliminate the outbound HTTP request that triggers the RGS-012 security finding.

After making the change:
1. Update the PR description to summarize what was changed and why (replacing curl with Python socket, referencing RGS-012).
2. Run `make recompile` to regenerate daily-fact.lock.yml and any other affected lock files.
3. Run `make agent-finish` to validate all checks pass (build, test, lint, recompile, fmt, lint-errors).
4. If a test file covers this workflow or the health check logic, add or update a test to cover the new TCP socket path.
5. Mark the PR as ready for review once all checks are green.

Generated by Contribution Check · ● 2.2M ·

Copilot AI changed the title [WIP] Fix secret exfiltration issue in daily-fact workflow fix(security): replace curl health check with TCP socket check in MemPalace MCP server startup Apr 24, 2026
Copilot AI requested a review from pelikhan April 24, 2026 21:17
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot remove /mcp curl check

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot remove /mcp curl check

Done in 035609b — the curl -sf http://127.0.0.1:8765/mcp check has been removed and replaced with a Python TCP socket probe that doesn't issue any HTTP request.

@pelikhan pelikhan marked this pull request as ready for review April 24, 2026 21:26
Copilot AI review requested due to automatic review settings April 24, 2026 21:26
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Replaces an HTTP curl readiness check with a TCP-only socket probe when starting the MemPalace MCP server to avoid Runner-Guard RGS-012 triggering on outbound HTTP requests.

Changes:

  • Updated MemPalace MCP server startup to wait on TCP port readiness via a Python socket connect.
  • Regenerated daily-fact.lock.yml to reflect the updated shared MCP startup snippet and updated metadata hashes.
Show a summary per file
File Description
.github/workflows/shared/mcp/mempalace.md Swaps the curl HTTP health check for a Python TCP socket probe during server startup.
.github/workflows/daily-fact.lock.yml Regenerated lockfile reflecting the updated MemPalace startup logic and updated prompt/config heredoc IDs.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

# Wait for server to start (TCP port check avoids outbound HTTP requests)
for i in $(seq 1 10); do
if curl -sf http://127.0.0.1:8765/mcp >/dev/null 2>&1; then
if python3 -c "import socket; s=socket.socket(); s.settimeout(1); s.connect(('127.0.0.1', 8765)); s.close()" 2>/dev/null; then
Copilot AI and others added 2 commits April 24, 2026 21:29
…filtration-issue

# Conflicts:
#	.github/workflows/daily-fact.lock.yml

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot merge main and recompile

Done in 2f61b7e — merged origin/main and recompiled all 201 workflow lock files.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw P07KWg7UknOO (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw Iw/z9U4yuXOJa8cJ-C (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan
Copy link
Copy Markdown
Collaborator

Remove the check entirely. Do not use python or curl. @copilot

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

Remove the check entirely. Do not use python or curl. @copilot

Done in de1ecc4 — the entire readiness check (loop, python socket probe, and error handler) has been removed. The step now simply starts the server in the background and logs the PID.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .default_branch (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title fix(security): replace curl health check with TCP socket check in MemPalace MCP server startup fix(security): remove readiness check from MemPalace MCP server startup Apr 24, 2026
@pelikhan pelikhan merged commit f216a16 into main Apr 24, 2026
@pelikhan pelikhan deleted the copilot/fix-secret-exfiltration-issue branch April 24, 2026 21:40
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.

[static-analysis] RGS-012: Secret Exfiltration via Outbound HTTP Request in daily-fact

3 participants