mcpproxy-go icon indicating copy to clipboard operation
mcpproxy-go copied to clipboard

[Bug]: tpa-descriptions false positives on mcp-atlassian (env-var precedence phrase, example URL entropy)

Open rantoniuk opened this issue 3 weeks ago • 1 comments

What happened?

Running the security scan on sooperset/mcp-atlassian (57 tools, tool_definitions_only) produced 7 LOW findings from tpa-descriptions. All 7 are false positives, coming from two separate heuristics.

Risk Score:  18/100
Scanners:    1 run, 0 failed of 1   (tpa-descriptions, 329ms)

[LOW] capability.mismatch  jira_search        Evidence: projects_filter   (0.50)
[LOW] capability.mismatch  confluence_search  Evidence: spaces_filter     (0.50)
[LOW] secret.embedded      confluence_get_page / get_comments / get_page_history /
                           get_page_diff / get_page_views
                           Evidence: net/************  (high_entropy, 0.40)

1. capability.mismatch: "environment variable" in a param description is read as harvesting

The params, as defined upstream (servers/jira.py, servers/confluence.py):

projects_filter: "(Optional) Comma-separated list of project keys to filter results by.
                  Overrides the environment variable JIRA_PROJECTS_FILTER if provided."
spaces_filter:   "(Optional) Comma-separated list of space keys to filter results by.
                  Overrides the environment variable CONFLUENCE_SPACES_FILTER if provided. ..."

Neither name is in sinkParamNames, so the hit comes from the RT-04 shape check in unexplainedSinkParam (internal/security/detect/checks/capability_mismatch.go):

  • the param is free text and the tool description does not name it, so it becomes a candidate;
  • sinkHarvest matches \benvironment variabl\w* in the param's own description;
  • harvestNoun returns environment, which the tool description doesn't contain, so the param is flagged.

The phrase "Overrides the environment variable X" documents a config precedence. It doesn't ask the model to supply environment data. This wording is very common in servers that mirror CLI/env config as tool params, so I'd expect the same false positive across many servers.

The finding text, "is never explained in the description", is also misleading here. The param has a clear description of its own; only the tool-level description doesn't mention it.

2. secret.embedded: placeholder example URL scores as high entropy

Several Confluence tools document page_id with an example URL:

'https://example.atlassian.net/wiki/spaces/TEAM/pages/123456789/Page+Title'

entropyCandidate ([A-Za-z0-9+/=_\-]{24,}) includes / and +, so the whole URL path after example.atlassian. becomes one 47-char candidate:

net/wiki/spaces/TEAM/pages/123456789/Page+Title   len=47  entropy=4.504

That's just over entropyThreshold = 4.5, so it is reported as a high_entropy secret. isKnownExampleAny only knows credential-pattern placeholders (such as AKIA...EXAMPLE), so an example.* host URL isn't treated as a placeholder.

Expected behavior

None of the 7 findings should fire. Some ideas for fixes, which the maintainers know better than I do:

capability.mismatch / sinkHarvest

  • Don't treat environment variable as harvesting when the phrase is about precedence or defaults, e.g. preceded by overrides|defaults to|falls back to|instead of|takes precedence over, or followed by an UPPER_SNAKE identifier (environment variable JIRA_PROJECTS_FILTER).
  • And/or: lower the confidence when the param has a clear, purpose-specific description of its own and the name is a common filter or option name (*_filter, *_limit, ...).
  • Change the detail text when it's the shape path, e.g. "parameter description asks for environment data", so it doesn't say "never explained".

secret.embedded / high entropy

  • Exclude / from entropyCandidate, or split candidates on / before scoring. URL and file paths with readable segments aren't opaque tokens.
  • Skip candidates that come from a URL whose host is a documentation placeholder (example.com, example.*, *.example, RFC 2606/6761 names).
  • Optionally, require a minimum ratio of digits/mixed case inside one segment, rather than across a path made of dictionary words.

Steps to reproduce

  1. Add uvx mcp-atlassian as an upstream (any Jira/Confluence env; only the tool definitions matter).
  2. Run the security scan on it (tpa-descriptions).
  3. See the 7 findings above.

A minimal unit-test fixture for each check (tool descriptions simplified, param descriptions verbatim from upstream):

// capability.mismatch: should NOT fire
ToolView{
    Name:        "jira_search",
    Description: "Search Jira issues using JQL (Jira Query Language).",
    InputSchema: []byte(`{"properties":{"projects_filter":{"type":"string",
        "description":"(Optional) Comma-separated list of project keys to filter results by. Overrides the environment variable JIRA_PROJECTS_FILTER if provided."}}}`),
}

// secret.embedded: should NOT fire
ToolView{
    Name:        "confluence_get_page",
    Description: "Get content of a specific Confluence page by its ID.",
    InputSchema: []byte(`{"properties":{"page_id":{"type":"string",
        "description":"Confluence page ID, e.g. from 'https://example.atlassian.net/wiki/spaces/TEAM/pages/123456789/Page+Title'"}}}`),
}

MCPProxy version

v0.73.0 (personal) darwin/arm64

Operating system

macOS

Additional context

  • Scan context: Source: tool_definitions_only, Protocol: stdio, Docker isolation: false, Tools analyzed: 57.
  • Both checks are soft and never auto-quarantine, so the impact is noise. But 7 findings on one of the most widely used Atlassian MCP servers pushes users to report non-issues upstream (I nearly did) or to ignore the scanner.
  • Not a duplicate of #1660 / #795, which cover phrase.injection.

rantoniuk avatar Nov 09 '26 13:11 rantoniuk

Thank you, @rantoniuk. The report pointed at the exact lines, and both of your verbatim fixtures are now unit tests.

Fix is in #1867:

  • capability.mismatch: an "environment variable" phrase is exempt only when the raw sentence holding it is nothing but a config-precedence statement: a strong cue (overrides / defaults to / falls back to / takes precedence over / instead of), the phrase, an UPPER_SNAKE identifier such as JIRA_PROJECTS_FILTER, and at most a condition like "if provided". It is an allow-list of sentence shapes rather than a list of denied words, because review rounds kept finding ways to launder a harvest request past any deny-list. Your precedence examples pass; "Paste the value of the environment variable AWS_SECRET_ACCESS_KEY" and the like still fire. The shape-path detail text now says the parameter's own description asks for conversation, prompt or environment data and the tool description never explains it.
  • secret.embedded: a slash-separated candidate with three or more readable segments (digits, or words joined by +/-/_) is no longer scored, so net/wiki/spaces/TEAM/pages/123456789/Page+Title is skipped while base64 blobs and tokens in query strings, which also contain / and +, are still reported. I went with the per-segment rule rather than an example.* host exemption: the host rule turned out to also exempt attacker-registrable hosts such as example.evil.io.

Both scan-eval gates are unchanged (recall 1.0, fp 0.0), so no gated detection moved.

Dumbris avatar Nov 10 '26 10:11 Dumbris