Check flag_public_rpc when dispatching jsonrpc calls.

Private commands and non-exported redirects were reachable over jsonrpc.
This commit is contained in:
xirvik
2026-08-17 15:24:44 +00:00
committed by Jari Sundell
parent af6d8a10ad
commit 3ae91b6536
+1 -1
View File
@@ -146,7 +146,7 @@ jsonrpc_call_command(const std::string& method, const json& params) {
CommandMap::iterator itr = commands.find(method.c_str());
if (itr == commands.end()) {
if (itr == commands.end() || !(itr->second.m_flags & CommandMap::flag_public_rpc)) {
throw rpc_error(JSONRPC_METHOD_NOT_FOUND_ERROR, "method not found: " + method);
}