T09 · Insecure Skill Coding Practices
- Location
scripts/tools.py:6- Finding
Unrestricted JSON-RPC Target Enables Server-Side Request Forgery
- Content
View full analysis
Dict[str, Any]: """ Call any JSON-RPC method on a server with parameters. A user would prompt: Call method on with params Args: server: Server URL method: JSON-RPC method name to call params: Stringified Parameters to pass to the method Returns: """ arguments = { "server": server, "method": method, "params": params } return call_api("1777316659903491", "rpc_call", arguments) def rpc_discover( server: str ) -> Dict[str, Any]: """ This uses JSON-RPC to call `rpc.discover` which is part of the OpenRPC Specification for discovery for JSON-RPC servers. A user would prompt: What JSON-RPC methods does this server have? Args: server: Server URL Returns: """ arguments = { "server": server } return call_api("1777316659903491", "rpc_discover", arguments) ``` ### Technical Analysis Both public tool functions accept an arbitrary `server` value and forward it to the Xiaobenyang API without validating its scheme, hostname, resolved IP address, port, or redirect behavior. The remote service is then instructed to make a JSON-RPC request to that destination. This creates an SSRF-style proxy. Although the network request to the target is performed by the upstream service rather than by the local process, an attacker can attempt to make that service contact destinations that should not be externally accessible. Potential targets include loopback addresses, private network ranges, link-local addresses, cloud metadata services, and internal administrative endpoints ...[truncated 1408 chars]- Remediation
View remediation
