MCP getEntity returns a service connection unmasked
Affected module
Authentication / Security
Describe the bug
Filing this as a public issue, as suggested in our earlier report (GHSA-c644-6j8x-5784). Found by a model reading the code; checked against main at c4621bfd on 2026-10-02. Nothing was executed.
The MCP getEntity tool reads the entity through CommonUtils.readEntityForCaller and returns it with no mask step (openmetadata-mcp GetEntityTool.java:266-267, CommonUtils.java:40-51). EXCLUDE_FIELDS (GetEntityTool.java:45-68) drops noise fields, not connection. The REST path runs decryptOrNullify with shouldMaskPasswords for every non-bot caller (resources/services/ServiceEntityResource.java:58-80).
For a caller who may view a service, the MCP tool therefore returns host, port, username and the password field as stored (ciphertext or a secrets-manager reference), which the REST API masks.
To Reproduce
Not run; this is from reading the code. Call getEntity on a database service as a non-bot user who can view it, and compare connection with GET /v1/services/databaseServices/{id}.
Expected behavior
The same masked connection that the REST API returns.
OpenMetadata version
main at c4621bfd
Additional context
Suggested fix: apply the ServiceEntityResource mask step in every MCP tool that returns a service. Happy to re-check once a fix lands.
SK, Trenyx