Skip to content

MCP-420 Remove redundant warning about bind address#338

Open
sophio-japharidze-sonarsource wants to merge 1 commit intomasterfrom
MCP-420_remove_redundant_warning
Open

MCP-420 Remove redundant warning about bind address#338
sophio-japharidze-sonarsource wants to merge 1 commit intomasterfrom
MCP-420_remove_redundant_warning

Conversation

@sophio-japharidze-sonarsource
Copy link
Copy Markdown
Contributor

No description provided.

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod bot commented Apr 16, 2026

MCP-420

@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha bot commented Apr 16, 2026

Summary

This PR removes a redundant security warning about binding to 0.0.0.0. Two warnings existed:

  1. In McpSecurityFilter — always warned when bound to 0.0.0.0
  2. In HttpServerTransportProvider — also warned when bound to 0.0.0.0

The fix removes the first warning (which was redundant) and refines the second to only trigger when HTTPS is disabled. The logic is: binding to 0.0.0.0 with HTTPS enabled is acceptable, so only warn the user when both 0.0.0.0 binding AND HTTP (unencrypted) are active.

The .claude/settings.local.json addition appears to be a local development artifact for test tooling and is not part of the core change.

What reviewers should know

What to review:

  • The warning condition change in HttpServerTransportProvider.java (line 151): verify the logic correctly identifies when HTTPS is disabled
  • Confirm that removing the warning from McpSecurityFilter.java doesn't lose important security information — the remaining warning in HttpServerTransportProvider should be sufficient
  • Check if there are any tests that verify these warnings are triggered/suppressed appropriately

Key insight: This is a refinement of security messaging, not a removal of security. The single remaining warning is more nuanced — it only flags the risky case (unencrypted + exposed to all interfaces).


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

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

The warning logic refinement itself is correct — httpsEnabled is already in scope at that point (line 146 uses it to set protocol), and suppressing the 0.0.0.0 warning when HTTPS is active is a reasonable security trade-off. The removal of the duplicate warning in McpSecurityFilter is clean.

The main problem is an unrelated file that was accidentally committed.

🗣️ Give feedback

@@ -0,0 +1,12 @@
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a local Claude Code IDE settings file and should not be committed to the repository. It contains developer-specific tool permissions (Atlassian MCP, Bash) that are irrelevant to other contributors and could grant unintended permissions if consumed by CI or other automation environments.

Add .claude/settings.local.json to .gitignore and remove this file from the PR.

  • Mark as noise

Copy link
Copy Markdown
Member

@nquinquenel nquinquenel left a comment

Choose a reason for hiding this comment

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

This warning should be kept if the MCP is running via a JAR, it's a big security risk (DNS rebinding). 0.0.0.0 is only necessary in Docker environment.

Also, we should probably mention something new in the README + Doc:

  • If you are running the server locally on your machine, then add -p 127.0.0.1:8443:8443
  • If it's meant to run remotely, then we can keep -p 8443:8443

Comment on lines +1 to +12
{
"permissions": {
"allow": [
"mcp__atlassian__search",
"mcp__atlassian__getJiraIssue",
"mcp__atlassian__getJiraIssueRemoteIssueLinks",
"mcp__atlassian__getVisibleJiraProjects",
"mcp__atlassian__createJiraIssue",
"Bash(./gradlew test *)"
]
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you remove this please? 😅


// Warn about security risk when binding to all interfaces
if ("0.0.0.0".equals(host)) {
if ("0.0.0.0".equals(host) && !httpsEnabled) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally, this warning should be removed only in a Docker environment, it's still valid if the MCP is run via a JAR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also it doesn't matter whether it's HTTP or HTTPS, this binding impacts the surface attack, TLS just encrypt the transport but doesn't reduce the surface.

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