Skip to content

fix: harden experimental MCP server access#2830

Open
maxts0gt wants to merge 1 commit into
google:mainfrom
maxts0gt:codex/harden-mcp-sse-workspace
Open

fix: harden experimental MCP server access#2830
maxts0gt wants to merge 1 commit into
google:mainfrom
maxts0gt:codex/harden-mcp-sse-workspace

Conversation

@maxts0gt
Copy link
Copy Markdown

Summary

  • restrict experimental MCP scan paths to configured workspace roots, including symlink-aware path resolution
  • require an SSE bearer token when listening on non-loopback addresses, with optional OSV_SCANNER_MCP_SSE_TOKEN support
  • redact workspace roots from MCP scan output and wire ignore_glob_patterns into scanner exclude patterns

Refs #2785. Thanks @Tobsboy2 for the public report and suggested hardening direction.

Tests

  • go test ./cmd/osv-scanner/mcp ./pkg/osvscanner
  • UPDATE_SNAPS=true go test ./cmd/osv-scanner/mcp

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 21, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@maxts0gt
Copy link
Copy Markdown
Author

@googlebot I signed it!

@Tobsboy2
Copy link
Copy Markdown

Thanks for the fix and the detailed hardening work here, especially the workspace-root restrictions and SSE authentication changes. I appreciate the follow-up and the maintainer review.

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.

2 participants