Skip to content

fix(security): change default HOST from 0.0.0.0 to 127.0.0.1#336

Merged
polaz merged 2 commits intomainfrom
feat/#333-security-change-default-host-from-0000-to-127001
Mar 1, 2026
Merged

fix(security): change default HOST from 0.0.0.0 to 127.0.0.1#336
polaz merged 2 commits intomainfrom
feat/#333-security-change-default-host-from-0000-to-127001

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Mar 1, 2026

Summary

  • Default HOST changed from 0.0.0.0 to 127.0.0.1, preventing unintended network exposure of the MCP server and GITLAB_TOKEN to anyone on the same network
  • Docker environments (Dockerfile, docker-compose.yml, CLI-generated compose) explicitly set HOST=0.0.0.0 where required for port mapping
  • Documentation updated with clear security notes explaining the difference and when to use each value

Reference

Upstream fix: zereight/gitlab-mcp#289

Closes #333

- Default bind address is now 127.0.0.1 (localhost only), preventing
  unintended network exposure of the server and GITLAB_TOKEN
- Docker environments explicitly set HOST=0.0.0.0 where required:
  Dockerfile, docker-compose.yml, CLI-generated compose files
- Updated documentation with clear security notes explaining when
  and why to use each value

Closes #333
Copilot AI review requested due to automatic review settings March 1, 2026 09:23
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 1, 2026

Test Coverage Report

Overall Coverage: 95.86%

Metric Percentage
Statements 95.33%
Branches 86.4%
Functions 94.45%
Lines 95.86%

View detailed coverage report

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

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

This PR hardens the default server binding to localhost to reduce accidental network exposure of the MCP server (and any configured GITLAB_TOKEN), while keeping Docker deployments reachable by explicitly setting HOST=0.0.0.0 where port publishing is expected.

Changes:

  • Change default HOST from 0.0.0.0 to 127.0.0.1 in runtime config and unit tests.
  • Ensure Docker entrypoints (Dockerfile, docker-compose, CLI-generated compose) explicitly set HOST=0.0.0.0.
  • Update documentation and examples to reflect the new default and explain the security implications.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/config.ts Updates default HOST to 127.0.0.1 to prevent unintended network binding.
tests/unit/config.test.ts Adjusts expected default HOST in config unit test.
src/cli/docker/docker-utils.ts Ensures CLI-generated docker-compose includes HOST=0.0.0.0.
tests/unit/cli/docker/docker-utils.test.ts Updates compose-generation test expectations for the added HOST env entry.
docker-compose.yml Explicitly sets HOST: "0.0.0.0" in Docker services to preserve reachability via port mapping.
Dockerfile Sets ENV HOST=0.0.0.0 for container runtime default binding.
.env.example Updates example to default to 127.0.0.1 and adds clear security guidance.
docs/guide/configuration.md Documents the new default and adds a security note explaining Docker vs local binding.
docs/deployment/docker-standalone.md Updates documented default and clarifies Docker should use 0.0.0.0.
SSL.md Updates the environment variable reference default for HOST.

@polaz polaz enabled auto-merge (squash) March 1, 2026 09:27
@polaz polaz merged commit 039c369 into main Mar 1, 2026
14 checks passed
@polaz polaz deleted the feat/#333-security-change-default-host-from-0000-to-127001 branch March 1, 2026 09:27
sw-release-bot bot pushed a commit that referenced this pull request Mar 1, 2026
## [6.62.1](v6.62.0...v6.62.1) (2026-03-01)

### Bug Fixes

* **security:** change default HOST from 0.0.0.0 to 127.0.0.1 ([#336](#336)) ([039c369](039c369)), closes [#333](#333)
@sw-release-bot
Copy link
Copy Markdown

sw-release-bot bot commented Mar 1, 2026

🎉 This PR is included in version 6.62.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: Change default HOST from 0.0.0.0 to 127.0.0.1

2 participants