Details
Defense in depth
Tighten the Pydantic tool schema at src/mcp_atlassian/servers/confluence.py:1307:
file_path: Annotated[
str,
Field(
description="Relative path within the configured upload directory",
pattern=r"^(?!/)(?!.*\.\.)[\w\-./]+$",
),
]
This blocks absolute paths and .. at the MCP schema layer before the handler is even entered.
Additional hardening (out of scope but recommended)
- Default
streamable-httpto127.0.0.1instead of0.0.0.0, or require an auth token when bound to a non-loopback interface. - Document that
file_pathmust be confined to an operator-chosen directory and expose that directory via config.