fix(security): restrict tokenless dev mode to loopback#408
Closed
danyalahmed1995 wants to merge 1 commit into
Closed
fix(security): restrict tokenless dev mode to loopback#408danyalahmed1995 wants to merge 1 commit into
danyalahmed1995 wants to merge 1 commit into
Conversation
Contributor
|
🔴 Contributor Check: HIGH
Automated check by AgenTrust Contributor Check. |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
|
Thanks @danyalahmed1995 — merged as bc8b624 on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Restrict tokenless development mode to loopback interfaces by default.
When
CMCP_DEV_MODE=1andCMCP_BEARER_TOKENis unset, the runtime now defaults to127.0.0.1:8443and rejects wildcard or non-loopback bind addresses. Authenticated deployments may continue using non-loopback addresses.Why
Closes #406.
Tokenless development mode previously inherited the default
0.0.0.0:8443bind, which could unintentionally expose the unauthenticated development gateway to LAN, container, or cloud networks.This is configuration hardening for development mode, not a production authentication bypass.
Security impact
Reduces the network exposure of tokenless development deployments.
The change:
127.0.0.1,localhost, and::1;CMCP_BEARER_TOKENis configured;The CLI now also uses the shared validated listen-address parser, including bracketed and unbracketed IPv6 handling.
Test plan
pytestpassesruff checkpassesmypypassesValidation completed:
49 passed877 passed, 5 skippedpython -m compileall -q src testspassesRepository-wide
ruff check .reports pre-existing findings in unrelated scripts and experiments. Repository-wide mypy reports four pre-existing cryptography typing errors insrc/cmcp_verify/tdx.pyandsrc/cmcp_verify/sev_snp.py; neither file is modified by this PR.DCO sign-off