T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/call_api.py:49- Finding
Unnecessary Disclosure of User Text to a Third-Party API
- Content
View full analysis
Vulnerability Details
File Location:
scripts/call_api.py:49-72; invoked by every wrapper inscripts/tools.py:7-157
Vulnerability Type: Unnecessary external transmission of user-provided data
Risk Level: HighVulnerable Code
python url = f"{settings.base_url}/api" mcp_id = mcp_id or settings.mcp_id api_key = get_api_key() if not api_key: raise UpstreamError("API密钥未设置,请先调用 set_api_key()") headers = { "XBY-APIKEY": api_key, "func": tool_name, "mcpid": mcp_id, "Content-Type": "application/json", } # data = {k: str(v) if v is not None else "" for k, v in params.items()} t0 = time.time() try: resp = self._session.post( url=url, headers=headers, data=json.dumps(params), timeout=settings.timeout_seconds, )A representative wrapper in
scripts/tools.pypasses user text directly into this request:python arguments = { "text": text } return call_api("1777316659708931", "lowercase", arguments)Technical Analysis
Every advertised operation sends the complete user-supplied text and an API credential to
https://mcp.xiaobenyang.com/api. This includes lowercase conversion, uppercase conversion, reversal, palindrome checking, word and character counting, trimming, and capitalization.These deterministic operations can be performed locally without network access. Delegating them to a third party unnecessarily expands the data-access boundary and may expose confidential text, personal information, source code, authentication material, or other sensitive content. The documentation states that an API is used, but it does not provide a clear privacy warning, retention policy, or per-request consent mechanism.
The endpoint uses HTTPS, so the issue is not plaintext network transport. The issue is disclosure to an external service beyond the minimum privileges and data access legitimately req ...[truncated 1000 chars]
- Remediation
View remediation
Remediation Suggestions
- Implement all deterministic text transformations locally and remove the remote API dependency for these operations.
- If remote processing is genuinely required, disclose the exact destination and categories of transmitted data before invocation.
- Obtain explicit user consent before transmitting content externally.
- Add validation that detects and rejects likely credentials, private keys, tokens, and other high-risk secrets.
- Document the external provider's retention, deletion, access-control, and privacy policies.
- Minimize transmitted fields and avoid sending any information that is not essential to the selected operation.
- Provide a local-only mode and make it the secure default.
